ollama/api
code4me2 a8027c6386 server: add MCP client for JSON-RPC communication
Add core MCP client implementation for communicating with Model Context
Protocol servers over stdio using JSON-RPC 2.0.

MCPClient (server/mcp_client.go):
- JSON-RPC 2.0 client with request/response correlation
- Handles initialize, tools/list, tools/call lifecycle
- Secure environment variable filtering (blocks secrets, sanitizes PATH)
- Request timeouts and graceful shutdown
- Parses MCP tool definitions into Ollama's api.Tool format
- MCPClientOption pattern for dependency injection in tests

API Types (api/types.go):
- MCPServerConfig: Runtime server configuration
- MCPTool: Tool definition with JSON Schema inputSchema
- MCPToolResult: Execution result container

Relates to #7865
2025-12-28 15:06:47 -08:00
..
examples ci: restore previous linter rules (#13322) 2025-12-03 18:55:02 -08:00
client.go docs: fix link to modelfile.mdx (#13220) 2025-12-11 16:14:45 -08:00
client_test.go api/client: handle non-json streaming errors (#13007) 2025-12-01 15:10:16 -08:00
types.go server: add MCP client for JSON-RPC communication 2025-12-28 15:06:47 -08:00
types_test.go types: add nested property support for tool definitions (#13508) 2025-12-17 11:54:09 -08:00
types_typescript_test.go tools: support anyOf types 2025-08-05 16:46:24 -07:00