code4me2
|
abcb81bb07
|
cmd: add --tools flag for MCP server integration
Integrate MCP servers with the ollama CLI and add route handlers for
tool-enabled chat completions.
CLI (cmd/cmd.go):
- Add --tools flag to 'ollama run' command
- Supports path argument: --tools /path/to/directory
- Multi-round tool execution loop with result display
- Displays available tools on startup
Routes (server/routes.go, server/routes_tools.go):
- MCP server handling in chat completions
- /api/tools endpoint for tool listing
- Session-based MCP manager lifecycle
- Detailed documentation of MCP integration flow
Parser (harmony/harmonyparser.go):
- Handle embedded <think> segments in tool call responses
- Extract tool calls from thinking model outputs
Relates to #7865
|
2025-12-28 15:06:47 -08:00 |