Graphhopper MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Graphhopper MCP or direct API to plan optimal routes, geocode locations, optimize delivery stops, and analyze travel times through natural language.

Graphhopper logoGraphhopper
Api Key

GraphHopper is an enterprise-grade Directions API for routing, optimization, and geocoding across multiple vehicle types. It enables fast, reliable route planning and logistics automation for businesses.

13 Tools

Try Graphhopper now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Graphhopper
Try asking
TOOLS

Supported Tools

Every Graphhopper action and event your agent gets out of the box.

Capacity Clustering

Solve capacity-constrained clustering problems by assigning customers to clusters while minimizing total travel distance.

GraphHopper Geocoding

Tool to perform forward or reverse geocoding.

Get Cluster Solution

Tool to retrieve the solution of an asynchronous clustering job.

Get Matrix

Tool to compute a distance and/or time matrix using GET request with query parameters.

Get Matrix Solution

Tool to retrieve the result of an asynchronous matrix computation job.

GET Route

Tool to calculate the best path connecting two or more points using simple GET request.

Get Isochrone

Tool to compute isochrone polygons for a given point.

Calculate Matrix

Tool to calculate distance, time, or weight matrices via POST.

Get Custom Profiles

Retrieve all custom routing profiles for your GraphHopper account.

POST Route

Tool to calculate complex routes via POST /route.

Submit Matrix Job

Tool to submit a matrix computation job for asynchronous processing.

Map Match GPX Track

Map-match a GPX track using GraphHopper's Map Matching API.

GraphHopper VRP POST

Tool to initiate VRP optimization.

SETUP GUIDE

Connect Graphhopper MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK and Claude Agent SDK
2

Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });

console.log("Creating Tool Router session...");
const { mcp } = await composio.create('your-user-id');
console.log(`Tool Router session created: ${mcp.url}`);
Initialize the Composio client and create a Tool Router session
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText, stepCountIs } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: mcp.url,
    headers: { 'x-api-key': 'your-composio-api-key' }
  }
});

const tools = await client.tools();

const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{ role: 'user', content: 'Calculate driving route from Berlin to Munich' }],
  stopWhen: stepCountIs( 5 )
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent
SETUP GUIDE

Connect Graphhopper API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Graphhopper Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'Optimize routes for 5 delivery vehicles visiting 20 stops'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Graphhopper actions with your Agent

Why Use Composio?

AI Native Graphhopper Integration

  • Supports both Graphhopper MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for planning, optimizing, and geocoding routes

Managed Auth

  • Built-in API key management for Graphhopper
  • Central place to manage, scope, and revoke API keys
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Graphhopper
  • Scoped, least privilege access to Graphhopper services
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

Yes, Graphhopper requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Graphhopper.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Graphhopper tool your agent needs.Free to start.

Start building