Documentation
¶
Overview ¶
MCP server example — exposes a DraftCrew agent as an MCP-compatible endpoint.
This example starts an agent with built-in tools and an MCP server on :9100. Any MCP client can connect via SSE, discover tools, and call them.
Prerequisites:
- Ollama running locally with a model (default: gemma3:4b) OR any OpenAI-compatible API
Usage:
# Terminal 1 — start the server:
go run main.go
# Terminal 2 — test with curl:
# 1. Connect to SSE stream:
curl -N http://localhost:9100/sse
# 2. Initialize:
curl -X POST http://localhost:9100/message \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
# 3. List tools:
curl -X POST http://localhost:9100/message \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
Click to show internal directories.
Click to hide internal directories.