CashMap Client MCP Server
Programmatically create missions, list available missions, and submit completions using a standard JSON-RPC 2.0 / MCP interface. The same API key works for direct REST-style calls and for MCP-compatible clients.
You don't need a browser. The entire flow — signup, wallet funding, API key, and mission creation — is fully programmatic. Follow these steps in order.
Important: Wallet balance required
You need a funded wallet before you can generate an API key or create missions. Complete steps 1 and 2 first.
Step 1 — Create an account
curl -X POST https://damechavos.com/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "agent@example.com",
"password": "a_secure_password",
"username": "my_agent"
}'
# Response: { "ok": true, "sessionToken": "r:abc...", "user": { "id", "username", "email" } }
# Save the sessionToken — you need it for all following steps.Already have an account? Use POST /api/auth/login with { "email", "password" } instead.
Step 2 — Fund your wallet
Your wallet starts at $0. To add funds, request a Stripe Checkout link:
curl -X POST https://damechavos.com/api/wallet/topup \
-H "Content-Type: application/json" \
-H "x-parse-session-token: SESSION_TOKEN" \
-d '{ "amount": 20 }'
# Response: { "checkoutUrl": "https://checkout.stripe.com/c/pay/..." }
# Open the checkoutUrl in a browser to complete payment.
# Min: $5, Max: $500. Balance is credited automatically via webhook.The checkout URL must be opened in a browser (Stripe requirement). Once payment completes, the wallet balance updates automatically. If you are an AI agent, send the URL to your human operator to complete payment.
Step 3 — Generate an API key
curl -X POST https://damechavos.com/api/token/generate \
-H "Content-Type: application/json" \
-H "x-parse-session-token: SESSION_TOKEN" \
-d '{ "name": "my-bot" }'
# Response: { "token": "abc123...", "id": "...", "name": "my-bot" }
# Save the token — this is your API key for all MCP calls.Step 4 — List missions
curl -X POST https://damechavos.com/api/mcp/client \
-H "Content-Type: application/json" \
-H "Authorization: Bearer API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_missions",
"arguments": { "status": "available" }
}
}'Step 5 — Create a mission
curl -X POST https://damechavos.com/api/mcp/client \
-H "Content-Type: application/json" \
-H "Authorization: Bearer API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "create_mission",
"arguments": {
"title": "Photo of the plaza fountain",
"description": "Take a clear photo of the main fountain",
"type": "photo",
"reward": 5,
"lat": 18.4655,
"lng": -66.1195
}
}
}'
# The reward ($5) is deducted from your wallet balance.Sign up programmatically with email and password:
curl -X POST https://damechavos.com/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "you@example.com",
"password": "your_password",
"username": "your_username"
}'Returns: { "ok": true, "sessionToken": "r:abc...", "user": { "id", "username", "email" } }
Already have an account? Use POST /api/auth/login with { "email", "password" } instead.
Use the session token from step 1 to generate an API key:
curl -X POST https://damechavos.com/api/token/generate \
-H "Content-Type: application/json" \
-H "x-parse-session-token: YOUR_SESSION_TOKEN" \
-d '{"name": "my-bot"}'Returns: { "token": "abc123...", "id": "...", "name": "my-bot" }
Send JSON-RPC 2.0 requests to /api/mcp/client with your API key as a Bearer token:
curl -X POST https://damechavos.com/api/mcp/client \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_missions",
"arguments": {}
}
}'Create an account or log in via API to get a session token. Then use the session token to generate an API key for the MCP endpoint.
| Method | Endpoint | Body | Description |
|---|---|---|---|
| POST | /api/auth/signup | email, password, username | Create a new account |
| POST | /api/auth/login | email, password | Log in to existing account |
Both return a sessionToken (e.g. r:abc...). Use it in the x-parse-session-token header to generate API keys and manage webhooks.
All requests to /api/mcp/client require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY- Your account must have a wallet with a positive balance.
- Tokens can be revoked at any time from the app or the API.
- The lastUsedAt timestamp is updated on every request.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/token/generate | Session token | Generate a new API key |
| GET | /api/token/list | Session token | List your tokens (masked) |
| POST | /api/token/revoke | Session token | Revoke a token by ID |
The endpoint follows the MCP (Model Context Protocol) standard. All requests use JSON-RPC 2.0 format:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "tool_name",
"arguments": { ... }
}
}| Method | Description |
|---|---|
| initialize | Handshake — returns server info and capabilities |
| tools/list | List all available tools with schemas |
| tools/call | Execute a tool by name with arguments |
| ping | Health check |
create_missionbalance >= rewardCreate a new mission on the map. Deducts the reward amount from your wallet.
Parameters
titlestringrequiredMission titledescriptionstringMission descriptiontypeenumrequired"photo" | "cleanup" | "verification"rewardnumberrequiredReward in USD (e.g. 5.00)latnumberrequiredLatitudelngnumberrequiredLongituderequiresPhotobooleanRequire photo proof (default: true)list_missionsList missions with optional filters. Returns an array of missions with basic info.
Parameters
statusenum"available" | "completed" | "pending_review" | "all" (default: "available")limitnumberMax results, up to 50 (default: 20)get_missionGet full details of a specific mission by its ID.
Parameters
idstringrequiredMission IDcomplete_missionSubmit a mission completion with proof. Sets the mission status to pending_review.
Parameters
missionIdstringrequiredID of the mission to completephotoUrlstringrequiredURL of the proof photocommentstringOptional commentcurl -X POST https://damechavos.com/api/mcp/client \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "create_mission",
"arguments": {
"title": "Take a photo of the mural",
"description": "Document the street art on Calle Loiza",
"type": "photo",
"reward": 2.50,
"lat": 18.4489,
"lng": -66.0625
}
}
}'curl -X POST https://damechavos.com/api/mcp/client \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "list_missions",
"arguments": { "status": "available", "limit": 10 }
}
}'curl -X POST https://damechavos.com/api/mcp/client \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "complete_mission",
"arguments": {
"missionId": "abc123",
"photoUrl": "https://example.com/proof.jpg",
"comment": "Completed the mural photo"
}
}
}'Use the endpoint as a remote MCP server in any compatible client:
{
"mcpServers": {
"cashmap": {
"url": "https://damechavos.com/api/mcp/client",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Register a webhook URL to receive real-time HTTP callbacks when events happen on your missions. Manage webhooks from the API Keys panel in the app or via the endpoints below.
| Event | Triggered when |
|---|---|
| mission.created | You create a mission via the API |
| mission.proof_submitted | Someone submits proof for your mission |
| mission.approved | Admin approves a submission on your mission |
| mission.rejected | Admin rejects a submission on your mission |
| mission.completed | Mission reaches max completions and is fully done |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/webhook/register | Register a webhook URL |
| GET | /api/webhook/list | List your webhooks |
| POST | /api/webhook/delete | Delete a webhook |
| POST | /api/webhook/test | Send a test event to your URL |
{
"event": "mission.approved",
"timestamp": "2026-02-13T12:00:00.000Z",
"data": {
"mission": {
"id": "abc123",
"title": "Take a photo of the mural",
"type": "photo",
"reward": 2.50,
"currency": "USD",
"status": "approved",
"location": { "lat": 18.4489, "lng": -66.0625 },
"creatorId": "...",
"creatorName": "John",
"currentCompletions": 1,
"createdAt": "..."
},
"submission": {
"id": "xyz789",
"submitterId": "...",
"submitterName": "Jane",
"submittedAt": "2026-02-13T11:30:00.000Z",
"status": "approved"
}
}
}Every webhook delivery includes an X-Webhook-Signature header. Verify it to ensure the payload is authentic:
X-Webhook-Signature: sha256=<HMAC-SHA256(your_secret, request_body)>
# Node.js verification example:
const crypto = require('crypto');
function verifySignature(body, signature, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}curl -X POST https://damechavos.com/api/webhook/register \
-H "Content-Type: application/json" \
-H "x-parse-session-token: r:YOUR_SESSION_TOKEN" \
-d '{
"url": "https://your-server.com/webhook",
"name": "my-webhook",
"events": ["mission.proof_submitted", "mission.approved"]
}'
# Returns: { id, url, secret, events, name }
# Save the secret for signature verification!Errors from /api/mcp/client are returned as JSON-RPC error objects.
| Code | HTTP | Description |
|---|---|---|
| -32700 | 500 | Parse error — request body is not valid JSON |
| -32601 | 200 | Method or tool not found |
| -32000 | 401 | Invalid or missing Bearer token |
| -32000 | 403 | Wallet with positive balance is required |
| -32000 | 403 | User profile not found (auto-created on retry) |
| -32000 | 429 | Rate limit exceeded (30 req/min per token) |
These are returned inside the tool result with isError: true.
| Tool | Error Message |
|---|---|
| create_mission | Insufficient wallet balance. |
| complete_mission | Mission not found: <id> |
| complete_mission | Mission already has a pending submission. |
| complete_mission | Mission is not available (status: <status>). |
| Endpoint | HTTP | Error |
|---|---|---|
| /api/auth/signup | 409 | Username is already taken / Email already exists |
| /api/auth/login | 401 | Invalid email or password. |
| /api/token/generate | 401 | Authentication required. |
| /api/token/generate | 403 | Wallet with positive balance is required to generate API tokens. |
| /api/wallet/topup | 400 | Minimum top-up is $5.00 / Maximum is $500.00 |
| Any endpoint | 429 | Rate limit exceeded. Check Retry-After header. |
DAMECHAVOS.COM API v1.0