OmniForge

Product guides · Trusted local networks only

MCP protocol support

OmniForge implements a small, handwritten subset of the Model Context Protocol over HTTP, in app/main.py (_handle_rpc) and app/mcp_server.py (MCPHandler). The official mcp Python SDK is installed as a dependency, but the transport doesn't use it. This page describes exactly what the code does.

Transport

Aspect Behaviour
Endpoint POST /mcp
Request One JSON-RPC 2.0 request object per HTTP request. Content-Type: application/json
Response Always application/json with one JSON-RPC response, whatever the Accept header says
Batches (JSON arrays) Not supported. HTTP 422
Sessions None. No Mcp-Session-Id is issued or read. Every request stands alone
MCP-Protocol-Version header Ignored
Server-to-client messages None. No SSE responses, notifications or requests from the server
GET /mcp An unauthenticated stub. It sends event: initial-connections and data: {"protocolVersion": "2024-11-05"}, then closes. It isn't a working SSE channel
DELETE /mcp Not routed (HTTP 405)
Legacy HTTP+SSE transport (2024-11-05) Not supported. There's no endpoint event and no separate message URL
Auth Optional static Bearer key. No OAuth, no /.well-known metadata, no WWW-Authenticate challenge
Origin / Host validation None

In short, it's "JSON-RPC over POST", which overlaps with the request/response part of Streamable HTTP. Clients that need anything more will fail.

Envelope handling

Input Result
jsonrpc field Not checked. Responses always say "jsonrpc": "2.0"
id Echoed back exactly. A missing id is echoed as null
params missing Treated as {}
params not an object (null, an array or a string) Error -32602, "params must be a JSON object"
Unknown method, or no method Error -32601, "Method not found: <method>" (or None)
Notifications (no id), for example notifications/initialized Answered with -32601 and "id": null, HTTP 200. Spec-compliant servers return HTTP 202 with no body
Auth failure HTTP 401, error -32000, "Unauthorized", "id": null

Methods

initialize

Request:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"example","version":"1.0"}}}

Response:

{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":false}},"serverInfo":{"name":"omniforge-mcp","version":"0.1.0"}}}

tools/list

{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
{"jsonrpc":"2.0","id":2,"result":{"tools":[
  {"name":"omniforge_instructions","description":"…","inputSchema":{"type":"object","properties":{},"additionalProperties":false}},
  {"name":"omniforge_create_tool","description":"…","inputSchema":{"type":"object","properties":{"name":{"…":"…"}},"required":["name","code"],"additionalProperties":false}},
  {"name":"add_vat","description":"Add UK VAT…","inputSchema":{"type":"object","properties":{"net":{"type":"number"}},"required":["net"],"additionalProperties":false}}
]}}

tools/call

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"add_vat","arguments":{"net":10}}}
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"{\"net\": \"10\", \"rate\": \"20\", \"vat\": \"2.00\", \"gross\": \"12.00\"}"}],"isError":false}}

Built-in tools are described in Built-in authoring tools (repository access required).

ping

{"jsonrpc":"2.0","id":4,"method":"ping"}
{"jsonrpc":"2.0","id":4,"result":null}

The result is null. The specification expects an empty object {}, and strict clients may object.

Not implemented

Feature Status
resources/*, prompts/*, completion/complete, logging/setLevel, sampling/*, elicitation/*, roots/* Not implemented (-32601)
notifications/tools/list_changed Never sent. Clients must refresh tools/list themselves
notifications/cancelled, notifications/progress Not handled
JSON-RPC batching Not supported
Session management, resumability Not supported
OAuth 2.1 authorisation Not supported

Compatibility notes


← Home · Next: Development and testing → (repository access required)