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/mcp

Transport: 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.

  1. Discover: GET /.well-known/oauth-authorization-server
  2. Register: POST to /api/oauth/register with { client_name, redirect_uris }. Receive client_id and client_secret.
  3. 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.
  4. Exchange: POST /api/oauth/token with grant_type=authorization_code, code, redirect_uri, code_verifier, plus client credentials. Receive access_token (JWT) and refresh_token.
  5. Call MCP: include Authorization: Bearer <access_token> on every tools/call for 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

ToolAuthArgumentsReturnsNotes
list_citiesPublicArray of cities.Public.
list_cab_routesPublic{ limit? }Array of routes with distance, duration, starting fare.26+ routes.
list_cab_typesPublichatchback / sedan / SUV with capacity.
get_fare_estimatePublic{ from, to, cab_type? }{ price, distance, duration, currency }Exact match for known routes.
search_routesPublic{ query }Matching routes for partial city name.
create_booking_intentbooking: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_statusbooking: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

  1. Agent calls get_fare_estimate or list_cab_routes to confirm price and availability.
  2. Agent calls create_booking_intent with pickup, drop, time, and (optionally) passenger details.
  3. Server returns completion_url — a signed, time-limited link.
  4. User opens the link in their browser, enters OTP, confirms payment via Razorpay.
  5. Agent polls get_booking_status until 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.

Find Us Here

CityTaxis Outstation Airport Taxi

Contact Us

Address: CityTaxis Outstation Airport Taxi, Secotr 4D, Bokaro, Jharkhand

Phone: +91-9798642711

Email: [email protected]

CallBook a cab — from ₹500