Skip to content

Latest commit

 

History

38 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Namma Yatri Connectors

A toolkit for booking and managing rides on the Namma Yatri platform. Provides three interfaces:

Interface Location Use Case
MCP Server mcp/ AI assistants (Claude Desktop, Cursor, etc.)
CLI cli/ Terminal-based ride booking
Skill skill.md LLM tools without MCP support (openClaw, etc.)

Quick Start

CLI (recommended for terminal users)

curl -sSL https://raw.githubusercontent.com/nammayatri/ny-connectors/main/install.sh | sh

Then:

nycli auth --mobile 9876543210 --code YOUR_ACCESS_CODE
nycli places "Koramangala"
nycli search --from-lat 12.935 --from-lon 77.624 --to-lat 12.971 --to-lon 77.594
nycli status

Run nycli help for all commands.

Skill (for LLM tools)

Copy skill.md into your LLM tool's skill/instruction configuration. It contains curl-based API calls for all ride-booking operations.

MCP Server (for AI assistants)

cd mcp
npm install
npm run build
npm start

Repository Structure

ny-connectors/
├── mcp/                          # MCP server (TypeScript)
│   ├── src/
│   │   └── index.ts              # Server implementation (~2000 lines)
│   ├── package.json
│   ├── tsconfig.json
│   └── Dockerfile
├── cli/
│   └── nycli.sh                  # Bash CLI tool
├── skill.md                      # LLM skill file (curl-based)
├── install.sh                    # CLI installer
├── CLAUDE.md                     # Claude Code instructions
├── .github/
│   └── workflows/
│       └── docker-build-simple.yml
└── README.md

CLI Reference

Installation

curl -sSL https://raw.githubusercontent.com/nammayatri/ny-connectors/main/install.sh | sh

Installs nycli to ~/.local/bin/. Requires curl and bash. Install jq for formatted output.

Commands

Command Description
nycli auth Authenticate with Namma Yatri
nycli places <text> Search for places (autocomplete)
nycli place-details Get place coordinates and address
nycli search Search for available rides
nycli select Select an estimate to book a ride
nycli tip Add a tip and select estimate
nycli cancel Cancel an active search
nycli status Check ride booking status
nycli saved-locations List saved locations (Home, Work, etc.)
nycli help Show help

Examples

# Authenticate
nycli auth --mobile 9876543210 --code YOUR_CODE

# Interactive auth (prompts for input)
nycli auth

# Search for a place
nycli places "Koramangala"

# Get coordinates for a place
nycli place-details --place-id "ChIJx9..."

# Get address from coordinates
nycli place-details --lat 12.935 --lon 77.624

# Search for rides
nycli search --from-lat 12.935 --from-lon 77.624 --to-lat 12.971 --to-lon 77.594

# Select an estimate
nycli select --estimate-id "abc-123"

# Select multiple estimates
nycli select --estimate-id "abc-123" --also "def-456,ghi-789"

# Add a tip
nycli tip --estimate-id "abc-123" --amount 20

# Cancel a search
nycli cancel --estimate-id "abc-123"

# Check active rides
nycli status --active

# Check all rides
nycli status --all

# List saved locations
nycli saved-locations

Environment Variables

Variable Default Description
NY_API_BASE https://api.moving.tech/pilot/app/v2 API base URL

Token Storage

The CLI stores authentication tokens at ~/.namma-yatri/token.json. This file is created with 600 permissions (owner-only read/write).


MCP Server Reference

Setup

cd mcp
npm install
npm run build

Development

cd mcp
npm run dev     # Run with tsx (hot reload)
npm run watch   # Continuous TypeScript compilation

Running as HTTP Server

cd mcp
npm start
# Or with custom port:
PORT=3000 HOST=0.0.0.0 npm start

Endpoints:

  • SSE: http://localhost:3000/sse
  • Messages: http://localhost:3000/message
  • Health: http://localhost:3000/health

MCP Client Configuration

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "namma-yatri": {
      "command": "node",
      "args": ["/path/to/ny-connectors/mcp/dist/index.js"]
    }
  }
}

Cursor

{
  "mcp.servers": {
    "namma-yatri": {
      "command": "node",
      "args": ["/path/to/ny-connectors/mcp/dist/index.js"]
    }
  }
}

Remote (HTTP/SSE)

{
  "mcpServers": {
    "namma-yatri": {
      "type": "http",
      "url": "http://localhost:3000/sse"
    }
  }
}

MCP Tools

Tool Description
get_token Authenticate with Namma Yatri
get_places Autocomplete place search
get_place_details Get place coordinates/address
search_ride Search for rides (polls for estimates)
select_estimate Select estimate(s) for booking
add_tip Add tip and select estimate
cancel_search Cancel active search
fetch_status Check ride booking status
get_saved_locations List saved locations

Environment Variables (MCP)

Variable Default Description
NAMMA_YATRI_API_BASE https://api.sandbox.moving.tech/dev/app/v2 API base URL
PORT 3000 HTTP server port
HOST 0.0.0.0 HTTP server host

Skill File

The skill.md file at the repo root contains curl-based instructions for all Namma Yatri API operations. It is designed for LLM tools that support skill/instruction files but not MCP (e.g., openClaw).

To use: copy skill.md into your LLM tool's skill configuration.


Docker (MCP)

docker build -t ny-mcp ./mcp
docker run -p 3000:3000 ny-mcp

The CI pipeline builds and pushes the MCP image to ghcr.io/nammayatri/ny-mcp on pushes to main and version tags.


Example Flow

1. Authenticate:    nycli auth
2. Search place:    nycli places "Koramangala"
3. Get details:     nycli place-details --place-id "ChIJ..."
4. Search rides:    nycli search --from-lat 12.93 --from-lon 77.62 --to-lat 12.97 --to-lon 77.59
5. Book a ride:     nycli select --estimate-id "abc-123"
6. Check status:    nycli status
7. Cancel if needed: nycli cancel --estimate-id "abc-123"

License

ISC

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages