@chuxin0816/coco
v0.1.2
Published
MCP server wrapper for the coco CLI AI tool
Maintainers
Readme
Coco MCP Server
MCP (Model Context Protocol) server wrapper for the coco CLI AI assistant tool.
Overview
This MCP server exposes the coco CLI tool as an MCP tool, allowing AI assistants like Claude Desktop to interact with coco programmatically.
Prerequisites
- Node.js 18 or higher
- The
cocoCLI tool must be installed and available in your PATH
To verify coco is installed:
coco --versionInstallation
Using npx (Recommended)
No installation needed! Just configure your MCP client to use npx (see Configuration section below).
Global Installation
npm install -g @chuxin0816/cocoLocal Development
git clone <your-repo>
cd coco-mcp
npm install
npm run buildConfiguration
Claude Desktop
Add the following to your Claude Desktop configuration file:
Location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Configuration:
{
"mcpServers": {
"coco": {
"command": "npx",
"args": ["@chuxin0816/coco"]
}
}
}Or if you installed globally:
{
"mcpServers": {
"coco": {
"command": "coco-mcp"
}
}
}Or use the Claude CLI:
claude mcp add @chuxin0816/cocoOther MCP Clients
For other MCP clients, configure them to run coco-mcp as a stdio server.
Available Tools
coco_query
Execute a query using the coco CLI AI assistant.
Parameters:
prompt(required, string): The prompt/question to send to coco
Example Usage:
In Claude Desktop, you can use this tool by asking Claude to:
- "Use coco to explain what a closure is in JavaScript"
- "Ask coco to generate a Python function for sorting a list"
- "Query coco about best practices for React hooks"
Development
Build
npm run buildWatch Mode
npm run watchTesting Locally
You can test the MCP server locally using the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.jsOr test it directly:
node dist/index.jsThe server will start and wait for MCP protocol messages on stdin.
How It Works
- The MCP server runs as a stdio server
- When the
coco_querytool is called, it executescoco -p "prompt" - The output from coco is returned to the MCP client
- The client (e.g., Claude Desktop) can then use this information in the conversation
Troubleshooting
"coco: command not found"
Make sure coco is installed and available in your PATH. Test with:
which coco
coco --versionPermission Issues
If you get permission errors, make sure the compiled JavaScript file is executable:
chmod +x dist/index.jsServer Not Starting
Check the stderr output for error messages. The server logs to stderr (not stdout, which is used for MCP protocol communication).
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
