Skip to content

Connecting MCP Clients

farzad edited this page Oct 7, 2026 · 1 revision

Connecting MCP Clients

Peykan speaks three MCP transports:

Transport Endpoint Typical clients
SSE (default) http://localhost:6278/sse MCP Inspector, Windsurf, ollmcp, most clients
Streamable HTTP http://localhost:6278/mcp Newer clients; start with --transport streamable-http
stdio the client starts peykan itself Claude Desktop and other local-subprocess configs

For the HTTP transports, start the server first with peykan demo (simulated vehicle) or peykan server (real hardware or replayed logs only).

On connect, the server sends clients short instructions on which tool answers which question, and offers five prompts.

Claude Desktop (stdio)

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "peykan": {
      "command": "peykan",
      "args": ["demo", "--transport", "stdio"]
    }
  }
}

Use the full path to peykan (e.g. from where peykan / which peykan) if Claude Desktop can't find it. Logs go to stderr, so they don't interfere with the protocol.

VS Code, Cursor, Windsurf and other HTTP clients

Run peykan demo, then add a server with URL http://localhost:6278/sse in the client's MCP settings. These clients use their own models.

MCP Inspector

A browser UI for calling tools by hand, handy for exploring:

npx @modelcontextprotocol/inspector

Connect to http://localhost:6278/sse.

Ollama (local models)

Ollama runs models but can't connect to MCP servers itself; ollmcp bridges the two.

  1. Pull a model with tool calling that fits your GPU, e.g. ollama pull qwen3:8b. Check with ollama show <model>: tools must be listed under Capabilities (the original llama3 can't call tools).
  2. Terminal A: peykan demo
  3. Terminal B:
    pip install ollmcp
    ollmcp -u http://localhost:6278/sse -m qwen3:8b
  4. In the chat, run once:
    • /tm turns thinking mode off. With thinking on, answers take 20–60 s and ollmcp sometimes drops the tool call after thinking ("No Response from Model").
    • /hil stops the confirmation prompt before every tool call.
    • /diagnose_vehicle runs the health-check prompt.
  5. Ask in plain language: "What's the latest vehicle speed?"

If replies are slow or stuck on "working...", check ollama ps while it answers. On laptops with integrated and dedicated graphics, Ollama may pick the integrated GPU; set OLLAMA_VULKAN=0 and OLLAMA_CONTEXT_LENGTH=8192 and restart Ollama (on Windows: setx both, then Quit from the tray icon and relaunch).

Open WebUI can also use Ollama models with MCP tools.

Tips for small models

  • Name the tool if a model takes a roundabout route: "use get_vehicle_snapshot".
  • Tools that take IDs accept hex strings ("0xF004") and J1939 acronyms ("EEC1"), so models don't have to convert hex to decimal, a common source of wrong requests.
  • The prompts package multi-step tasks so the model doesn't have to plan the sequence itself.

Clone this wiki locally