CityTaxis for Developers
CityTaxis exposes an MCP (Model Context Protocol) server so AI agents like Claude, ChatGPT, and Cursor can search routes, estimate fares, and initiate taxi bookings on behalf of users — programmatically, with no API keys.
MCP endpoint
https://www.citytaxis.in/api/mcpTransport: HTTP JSON-RPC. Read tools are public. Booking tools (create_booking_intent, get_booking_status) require an OAuth 2.1 access token with scope booking:write. Discovery files at /.well-known/mcp.json and /.well-known/oauth-authorization-server.
OAuth 2.1 (booking tools only)
Follow the standard authorization-code-with-PKCE flow. CityTaxis supports Dynamic Client Registration (RFC 7591), so MCP-aware clients (Claude.ai, ChatGPT, etc.) register themselves on first use — no manual key issuance.
- Discover: GET
/.well-known/oauth-authorization-server - Register: POST to
/api/oauth/registerwith{ client_name, redirect_uris }. Receiveclient_idandclient_secret. - Authorize: redirect the user to
/oauth/authorize?response_type=code&client_id=…&redirect_uri=…&scope=booking:write&state=…&code_challenge=…&code_challenge_method=S256. The user signs in (Google), sees a consent screen, and clicks Allow. - Exchange: POST
/api/oauth/tokenwithgrant_type=authorization_code,code,redirect_uri,code_verifier, plus client credentials. Receiveaccess_token(JWT) andrefresh_token. - Call MCP: include
Authorization: Bearer <access_token>on everytools/callfor write tools.
Access tokens last 1 hour; refresh tokens 30 days. Without a valid token, write tools return 401 with a WWW-Authenticate header pointing at the resource metadata.
Tools
| Tool | Auth | Arguments | Returns | Notes |
|---|---|---|---|---|
| list_cities | Public | — | Array of cities. | Public. |
| list_cab_routes | Public | { limit? } | Array of routes with distance, duration, starting fare. | 26+ routes. |
| list_cab_types | Public | — | hatchback / sedan / SUV with capacity. | |
| get_fare_estimate | Public | { from, to, cab_type? } | { price, distance, duration, currency } | Exact match for known routes. |
| search_routes | Public | { query } | Matching routes for partial city name. | |
| create_booking_intent | booking:write | { from, to, cab_type, pickup_time, passenger_name?, passenger_phone? } | { intent_id, completion_url, expires_at } | Returns one-time URL the human completes (OTP + payment). |
| get_booking_status | booking:write | { intent_id } | { status, booking_id? } | Status of an intent. |
Add CityTaxis to Claude Code
# Add the MCP server to Claude Code
claude mcp add citytaxis https://www.citytaxis.in/api/mcp
# Then ask Claude:
# "Get me a cab from Ranchi to Bokaro tomorrow at 9am"Same procedure for any MCP-aware client (ChatGPT custom GPTs, Cursor, Continue.dev, Cline). The server speaks the standard MCP JSON-RPC over HTTP.
Booking flow
- Agent calls
get_fare_estimateorlist_cab_routesto confirm price and availability. - Agent calls
create_booking_intentwith pickup, drop, time, and (optionally) passenger details. - Server returns
completion_url— a signed, time-limited link. - User opens the link in their browser, enters OTP, confirms payment via Razorpay.
- Agent polls
get_booking_statusuntil status =confirmed.
Why two-step? Card details and OTP never transit the MCP boundary. Agents can't accidentally leak payment info or charge a user without consent.
Questions?
Email [email protected] or call +91-9798642711.