diff --git a/acumen/features/api-endpoints/basics.md b/acumen/features/api-endpoints/basics.md new file mode 100644 index 000000000..35a568225 --- /dev/null +++ b/acumen/features/api-endpoints/basics.md @@ -0,0 +1,58 @@ +Based on the documentation and code I've reviewed, I can explain how to access Goose's API endpoints from Node.js. Goose follows the Model Cont +ext Protocol (MCP) for its extensions and API interactions. Here's what you need to know: + +1. **MCP Server Integration** +- Goose extensions are implemented as MCP servers +- You can interact with them using the MCP protocol +- The base functionality is exposed through command-line tools and MCP servers + +2. **Main Ways to Access APIs**: + +a) **Using NPX with MCP Inspector**: +```bash +npx @modelcontextprotocol/inspector cargo run -p mcp-server +``` +This allows you to inspect and test available endpoints through a browser interface. + +b) **Direct MCP Server Integration**: +You can add MCP servers as extensions using Node.js packages. For example: + +```bash +npx -y @modelcontextprotocol/server-github # For GitHub integration +uvx mcp-server-fetch # For the Fetch extension +``` + +3. **Built-in Extension APIs**: +The following extensions provide APIs you can access: +- Developer Tools +- Computer Controller +- Memory +- JetBrains +- Google Drive + +4. **Adding Custom Extensions**: +You can create your own Node.js based extensions by: +1. Creating an MCP server +2. Adding it to your Goose configuration +3. Accessing it via the MCP protocol + +5. **Configuration**: +Extensions can be configured in `~/.config/goose/config.yaml`: +```yaml +extensions: + your-extension: + name: YourExtension + cmd: npx + args: [-y @your/extension-package] + enabled: true + envs: { "YOUR_ENV_VAR": "" } + type: stdio +``` + +6. **Environment Variables**: +You can pass environment variables to the extensions for authentication and configuration. + +For more detailed implementation examples and access to specific endpoints, I recommend: +1. Using the MCP Inspector to explore available endpoints +2. Checking the [MCP Server Directory](https://github.com/modelcontextprotocol/servers) +3. Reading the specific extension documentation for the APIs you want to access diff --git a/logs/mcp-server.log.2025-02-11 b/logs/mcp-server.log.2025-02-11 new file mode 100644 index 000000000..2401d12cc --- /dev/null +++ b/logs/mcp-server.log.2025-02-11 @@ -0,0 +1,104 @@ +2025-02-11T00:36:07.458614Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T00:36:07.458705Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T00:36:07.458728Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T00:36:07.458865Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"sampling":{},"roots":{"listChanged":true}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"}}} + +2025-02-11T00:36:07.459107Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(0) method="initialize" json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{"roots":{"listChanged":true},"sampling":{}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"},"protocolVersion":"2024-11-05"}} +2025-02-11T00:36:07.459200Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(0) json={"jsonrpc":"2.0","id":0,"result":{"capabilities":{"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"This server provides a counter tool that can increment and decrement values. The counter starts at 0 and can be modified using the 'increment' and 'decrement' tools. Use 'get_value' to check the current count.","protocolVersion":"2024-11-05","serverInfo":{"name":"counter","version":"0.1.0"}}} +2025-02-11T00:36:07.466525Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","method":"notifications/initialized"} + +2025-02-11T00:36:25.012894Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":1,"method":"resources/list","params":{}} + +2025-02-11T00:36:25.013013Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(1) method="resources/list" json={"jsonrpc":"2.0","id":1,"method":"resources/list","params":{}} +2025-02-11T00:36:25.013229Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(1) json={"jsonrpc":"2.0","id":1,"result":{"resources":[{"annotations":{"priority":0.0,"timestamp":"2025-02-11T00:36:25.013156Z"},"mimeType":"text","name":"cwd","uri":"str:////Users/to/some/path/"},{"annotations":{"priority":0.0,"timestamp":"2025-02-11T00:36:25.013167Z"},"mimeType":"text","name":"memo-name","uri":"memo://insights"}]}} +2025-02-11T00:36:27.710509Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":2,"method":"resources/read","params":{"uri":"str:////Users/to/some/path/"}} + +2025-02-11T00:36:27.710735Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(2) method="resources/read" json={"jsonrpc":"2.0","id":2,"method":"resources/read","params":{"uri":"str:////Users/to/some/path/"}} +2025-02-11T00:36:27.710835Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(2) json={"jsonrpc":"2.0","id":2,"result":{"contents":[{"mime_type":"text/plain","text":"/Users/to/some/path/","uri":"str:////Users/to/some/path/"}]}} +2025-02-11T00:36:34.380499Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"memo://insights"}} + +2025-02-11T00:36:34.380621Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(3) method="resources/read" json={"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"memo://insights"}} +2025-02-11T00:36:34.380685Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(3) json={"jsonrpc":"2.0","id":3,"result":{"contents":[{"mime_type":"text/plain","text":"Business Intelligence Memo\n\nAnalysis has revealed 5 key insights ...","uri":"memo://insights"}]}} +2025-02-11T00:37:08.879934Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":4,"method":"tools/list","params":{}} + +2025-02-11T00:37:08.880061Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(4) method="tools/list" json={"jsonrpc":"2.0","id":4,"method":"tools/list","params":{}} +2025-02-11T00:37:08.880221Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(4) json={"jsonrpc":"2.0","id":4,"result":{"tools":[{"description":"Increment the counter by 1","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"increment"},{"description":"Decrement the counter by 1","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"decrement"},{"description":"Get the current counter value","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"get_value"}]}} +2025-02-11T00:37:23.579281Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":5,"method":"ping"} + +2025-02-11T00:37:23.579443Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(5) method="ping" json={"jsonrpc":"2.0","id":5,"method":"ping"} +2025-02-11T00:37:23.579609Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(5) json={"jsonrpc":"2.0","id":5,"error":{"code":-32601,"message":"ping"}} +2025-02-11T00:41:34.801447Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T00:41:34.801579Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T00:41:34.801605Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T00:42:42.268252Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T00:42:42.268367Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T00:42:42.268393Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T00:42:42.274425Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"sampling":{},"roots":{"listChanged":true}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"}}} + +2025-02-11T00:42:42.274842Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(0) method="initialize" json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{"roots":{"listChanged":true},"sampling":{}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"},"protocolVersion":"2024-11-05"}} +2025-02-11T00:42:42.274975Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(0) json={"jsonrpc":"2.0","id":0,"result":{"capabilities":{"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"This server provides a counter tool that can increment and decrement values. The counter starts at 0 and can be modified using the 'increment' and 'decrement' tools. Use 'get_value' to check the current count.","protocolVersion":"2024-11-05","serverInfo":{"name":"counter","version":"0.1.0"}}} +2025-02-11T00:42:42.282150Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","method":"notifications/initialized"} + +2025-02-11T00:42:58.286485Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}} + +2025-02-11T00:42:58.286611Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(1) method="tools/list" json={"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}} +2025-02-11T00:42:58.286765Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(1) json={"jsonrpc":"2.0","id":1,"result":{"tools":[{"description":"Increment the counter by 1","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"increment"},{"description":"Decrement the counter by 1","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"decrement"},{"description":"Get the current counter value","inputSchema":{"properties":{},"required":[],"type":"object"},"name":"get_value"}]}} +2025-02-11T00:43:08.021336Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":2,"method":"resources/list","params":{}} + +2025-02-11T00:43:08.021449Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(2) method="resources/list" json={"jsonrpc":"2.0","id":2,"method":"resources/list","params":{}} +2025-02-11T00:43:08.021679Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(2) json={"jsonrpc":"2.0","id":2,"result":{"resources":[{"annotations":{"priority":0.0,"timestamp":"2025-02-11T00:43:08.021600Z"},"mimeType":"text","name":"cwd","uri":"str:////Users/to/some/path/"},{"annotations":{"priority":0.0,"timestamp":"2025-02-11T00:43:08.021611Z"},"mimeType":"text","name":"memo-name","uri":"memo://insights"}]}} +2025-02-11T00:43:12.184357Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"str:////Users/to/some/path/"}} + +2025-02-11T00:43:12.185264Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(3) method="resources/read" json={"jsonrpc":"2.0","id":3,"method":"resources/read","params":{"uri":"str:////Users/to/some/path/"}} +2025-02-11T00:43:12.185359Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(3) json={"jsonrpc":"2.0","id":3,"result":{"contents":[{"mime_type":"text/plain","text":"/Users/to/some/path/","uri":"str:////Users/to/some/path/"}]}} +2025-02-11T00:43:17.120340Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":4,"method":"resources/read","params":{"uri":"memo://insights"}} + +2025-02-11T00:43:17.120459Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(4) method="resources/read" json={"jsonrpc":"2.0","id":4,"method":"resources/read","params":{"uri":"memo://insights"}} +2025-02-11T00:43:17.120591Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(4) json={"jsonrpc":"2.0","id":4,"result":{"contents":[{"mime_type":"text/plain","text":"Business Intelligence Memo\n\nAnalysis has revealed 5 key insights ...","uri":"memo://insights"}]}} +2025-02-11T00:43:41.787724Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":5,"method":"resources/read","params":{"uri":"str:////Users/to/some/path/"}} + +2025-02-11T00:43:41.787866Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(5) method="resources/read" json={"jsonrpc":"2.0","id":5,"method":"resources/read","params":{"uri":"str:////Users/to/some/path/"}} +2025-02-11T00:43:41.787976Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(5) json={"jsonrpc":"2.0","id":5,"result":{"contents":[{"mime_type":"text/plain","text":"/Users/to/some/path/","uri":"str:////Users/to/some/path/"}]}} +2025-02-11T00:43:52.687122Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"_meta":{"progressToken":0},"name":"decrement","arguments":{}}} + +2025-02-11T00:43:52.687297Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(6) method="tools/call" json={"jsonrpc":"2.0","id":6,"method":"tools/call","params":{"_meta":{"progressToken":0},"arguments":{},"name":"decrement"}} +2025-02-11T00:43:52.687385Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(6) json={"jsonrpc":"2.0","id":6,"result":{"content":[{"text":"-1","type":"text"}]}} +2025-02-11T00:43:54.419532Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"_meta":{"progressToken":1},"name":"decrement","arguments":{}}} + +2025-02-11T00:43:54.420252Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(7) method="tools/call" json={"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"_meta":{"progressToken":1},"arguments":{},"name":"decrement"}} +2025-02-11T00:43:54.420326Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(7) json={"jsonrpc":"2.0","id":7,"result":{"content":[{"text":"-2","type":"text"}]}} +2025-02-11T00:43:56.718384Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"_meta":{"progressToken":2},"name":"decrement","arguments":{}}} + +2025-02-11T00:43:56.718505Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(8) method="tools/call" json={"jsonrpc":"2.0","id":8,"method":"tools/call","params":{"_meta":{"progressToken":2},"arguments":{},"name":"decrement"}} +2025-02-11T00:43:56.719437Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(8) json={"jsonrpc":"2.0","id":8,"result":{"content":[{"text":"-3","type":"text"}]}} +2025-02-11T00:44:02.152890Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":9,"method":"ping"} + +2025-02-11T00:44:02.152999Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(9) method="ping" json={"jsonrpc":"2.0","id":9,"method":"ping"} +2025-02-11T00:44:02.153103Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(9) json={"jsonrpc":"2.0","id":9,"error":{"code":-32601,"message":"ping"}} +2025-02-11T00:44:34.431035Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T00:44:34.431124Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T00:44:34.431148Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T00:44:34.431348Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"sampling":{},"roots":{"listChanged":true}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"}}} + +2025-02-11T00:44:34.431693Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(0) method="initialize" json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{"roots":{"listChanged":true},"sampling":{}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"},"protocolVersion":"2024-11-05"}} +2025-02-11T00:44:34.431895Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(0) json={"jsonrpc":"2.0","id":0,"result":{"capabilities":{"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"This server provides a counter tool that can increment and decrement values. The counter starts at 0 and can be modified using the 'increment' and 'decrement' tools. Use 'get_value' to check the current count.","protocolVersion":"2024-11-05","serverInfo":{"name":"counter","version":"0.1.0"}}} +2025-02-11T00:44:34.435645Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","method":"notifications/initialized"} + +2025-02-11T00:44:36.262745Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T00:44:36.262843Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T00:44:36.262865Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T00:44:36.262998Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{"sampling":{},"roots":{"listChanged":true}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"}}} + +2025-02-11T00:44:36.263254Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:155: Received request request_id=Some(0) method="initialize" json={"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{"roots":{"listChanged":true},"sampling":{}},"clientInfo":{"name":"mcp-inspector","version":"0.0.1"},"protocolVersion":"2024-11-05"}} +2025-02-11T00:44:36.263348Z  INFO ThreadId(01) message_processing: crates/mcp-server/src/lib.rs:185: Sending response response_id=Some(0) json={"jsonrpc":"2.0","id":0,"result":{"capabilities":{"resources":{"listChanged":false,"subscribe":false},"tools":{"listChanged":false}},"instructions":"This server provides a counter tool that can increment and decrement values. The counter starts at 0 and can be modified using the 'increment' and 'decrement' tools. Use 'get_value' to check the current count.","protocolVersion":"2024-11-05","serverInfo":{"name":"counter","version":"0.1.0"}}} +2025-02-11T00:44:36.266357Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:68: incoming message json={"jsonrpc":"2.0","method":"notifications/initialized"} + +2025-02-11T07:05:44.461882Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T07:05:44.462033Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T07:05:44.462057Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T07:05:44.464271Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T07:05:44.464375Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T07:05:44.464400Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started +2025-02-11T07:05:44.466271Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:173: Starting MCP server +2025-02-11T07:05:44.466360Z  INFO ThreadId(01) crates/mcp-server/src/main.rs:182: Server initialized and ready to handle requests +2025-02-11T07:05:44.466717Z  INFO ThreadId(01) crates/mcp-server/src/lib.rs:143: Server started