diff --git a/mcp_config.json b/mcp_config.json index d531881607..700b12ee9f 100644 --- a/mcp_config.json +++ b/mcp_config.json @@ -10,4 +10,4 @@ ] } } -} \ No newline at end of file +} diff --git a/mcp_dummy.py b/mcp_dummy.py index 1fff089407..b20035dd4e 100644 --- a/mcp_dummy.py +++ b/mcp_dummy.py @@ -17,13 +17,13 @@ def main(): req = json.loads(line) except json.JSONDecodeError: continue - + if "method" in req: method = req["method"] req_id = req.get("id") - + resp = {"jsonrpc": "2.0", "id": req_id} - + if method == "initialize": resp["result"] = { "protocolVersion": "2024-11-05", @@ -51,9 +51,9 @@ def main(): params = req.get("params", {}) name = params.get("name") args = params.get("arguments", {}) - + logging.info(f"Tool call: {name} with {args}") - + content = [{"type": "text", "text": f"Weather in {args.get('location')} is 25C"}] # For simplicity, return raw content or follow MCP spec? # MCP spec: result: { content: [ {type: "text", text: "..."} ] } diff --git a/tools/cli/cli.cpp b/tools/cli/cli.cpp index 1e63ab9aa5..0a4b096897 100644 --- a/tools/cli/cli.cpp +++ b/tools/cli/cli.cpp @@ -168,7 +168,7 @@ struct cli_context { buf.assign((std::istreambuf_iterator(file)), std::istreambuf_iterator()); input_files.push_back(std::move(buf)); return mtmd_default_marker(); - } + } return std::string((std::istreambuf_iterator(file)), std::istreambuf_iterator()); } @@ -363,7 +363,7 @@ int main(int argc, char ** argv) { // process commands if (string_starts_with(buffer, "/exit")) { break; - } + } if (string_starts_with(buffer, "/regen")) { if (ctx_cli.messages.size() >= 2) { size_t last_idx = ctx_cli.messages.size() - 1; diff --git a/tools/cli/mcp.hpp b/tools/cli/mcp.hpp index 422cd2a807..8d8ce4de98 100644 --- a/tools/cli/mcp.hpp +++ b/tools/cli/mcp.hpp @@ -178,7 +178,7 @@ class mcp_server { if (err_thread.joinable()) { err_thread.join(); } - + // 5. Cleanup if (running) { subprocess_destroy(&process);