{"id":28769374,"url":"https://github.com/KunihiroS/claude-code-mcp","last_synced_at":"2025-06-17T13:13:43.882Z","repository":{"id":282734432,"uuid":"944975440","full_name":"KunihiroS/claude-code-mcp","owner":"KunihiroS","description":"MCP Server connects with claude code local command.","archived":false,"fork":false,"pushed_at":"2025-06-04T06:17:33.000Z","size":97,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-16T03:08:44.197Z","etag":null,"topics":["anthropic","anthropic-claude","claude","claude-code","mcp","mcp-server","model-context-protocol"],"latest_commit_sha":null,"homepage":"https://modelcontextprotocol.io/introduction","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KunihiroS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-08T11:12:05.000Z","updated_at":"2025-06-08T02:46:53.000Z","dependencies_parsed_at":"2025-03-16T16:37:28.681Z","dependency_job_id":"a2c7cd5e-85d5-40d3-b8ba-706343811a01","html_url":"https://github.com/KunihiroS/claude-code-mcp","commit_stats":null,"previous_names":["kunihiros/claude-code-mcp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/KunihiroS/claude-code-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KunihiroS%2Fclaude-code-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KunihiroS%2Fclaude-code-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KunihiroS%2Fclaude-code-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KunihiroS%2Fclaude-code-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KunihiroS","download_url":"https://codeload.github.com/KunihiroS/claude-code-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KunihiroS%2Fclaude-code-mcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260365115,"owners_count":22998052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic","anthropic-claude","claude","claude-code","mcp","mcp-server","model-context-protocol"],"created_at":"2025-06-17T13:03:52.709Z","updated_at":"2025-06-17T13:13:43.874Z","avatar_url":"https://github.com/KunihiroS.png","language":"JavaScript","funding_links":[],"categories":["🤖 AI/ML","Code Execution"],"sub_categories":[],"readme":"# claude-code-mcp Project\n\n## [0.1.4] - 2025-06-04\n\n### Changed\n- Updated dependency: `@anthropic-ai/claude-code` to the latest version (`0.2.126` as of 2025-06-04).\n- Removed the transitive dependency on the vulnerable `tar-fs` (\u003c2.1.3) to address a security alert (CVE).\n\n### Fixed\n- Added a record of the tar-fs vulnerability (CVE) mitigation.\n\n## Overview\n\nThe claude-code-mcp project is an MCP server for Claude Code.\n\nIt calls the locally installed Claude Code command and provides the following tools: `explain_code`, `review_code`, `fix_code`, `edit_code`, `test_code`, `simulate_command`, and `your_own_query`. The server is implemented using Node.js and the MCP SDK, receiving JSON format requests from clients via stdio. Internally, it adopts Base64 encoding to smoothly process special characters (newlines, quotation marks, etc.) in natural language text, resulting in improved stability and flexibility. Its main roles are receiving requests, encoding input, generating and executing commands, and returning execution results in JSON format.\nThis project has been confirmed to work in Claude Code CLI environments (Ubuntu/WSL2, etc.).\n\n\u003ca href=\"https://glama.ai/mcp/servers/@KunihiroS/claude-code-mcp\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@KunihiroS/claude-code-mcp/badge\" alt=\"claude-code-mcp MCP server\" /\u003e\n\u003c/a\u003e\n\n💡\nMCP Host with less capable LLM, can tame and make use of Claude power💪!\nWith claude-code-mcp, you can also call Claude Code from Claude Desktop!! 😇😜😎 (unconfirmed)\n\n## Functions\n\nThe main roles of the server are:\n\n-   **Request Reception:** Receive JSON format tool requests from clients (e.g. `code`, `context`, `focus_areas`, etc.).\n-   **Input Processing:** Internally Base64 encode the received natural language text.\n-   **Tool Selection and Command Generation:** Based on the tool name in the request, assemble a command string for the query using a fixed template or free format (`your_own_query`).\n-   **Command Execution:** Use Node.js's `child_process.spawn` to execute the assembled command and get the result from standard output.\n-   **Result Return:** Return the execution result to the client in JSON format.\n\n## Getting Started\n\n### Prerequisites\n\n-   Node.js (\u003e= v18 recommended, tested with v22.14.0)\n-   npm (or yarn)\n-   Claude Code command installed and auth completed.\n    https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview\n\n### Installation \u0026 Usage\n\nThere are several ways to use `claude-code-mcp`:\n\n**1. Using npx (Recommended for quick use)**\n\nYou can run the server directly without installation using `npx`:\n\n```bash\nnpx @kunihiros/claude-code-mcp\n```\n\n**2. Global Installation**\n\nInstall the package globally:\n\n```bash\nnpm install -g claude-code-mcp\n```\n\nThen, you can run it as a command:\n\n```bash\nclaude-code-mcp\n```\n\n**3. Local Installation (For development)**\n\nClone the repository and install dependencies:\n\n```bash\ngit clone https://github.com/KunihiroS/claude-code-mcp.git\ncd claude-code-mcp/claude-code-server\nnpm install\nnpm run build\n```\nYou can then run the built script directly:\n```bash\nnode build/index.js\n```\n\n### Configuration\n\n**Environment Variables:**\n\nRegardless of the installation method, you need to configure the environment variables. Create **one** of the following files:\n\n1.  **Using MCP Host Settings (Recommended for `npx`):** Configure environment variables directly within your MCP Host's settings (see \"MCP Host Configuration\" below). This is the easiest way when using `npx`.\n2.  **Using a `.env` file:** Create a `.env` file in the directory where you run the `npx @kunihiros/claude-code-mcp` command.\n3.  **Using a global config file:** Create a `.claude-code-mcp.env` file in your home directory (`~/.claude-code-mcp.env`).\n\nIf using a file (`.env` or `~/.claude-code-mcp.env`), add the following content, adjusting the `CLAUDE_BIN` path:\n\n```dotenv\n# .env or ~/.claude-code-mcp.env\nCLAUDE_BIN=/path/to/your/claude/executable  # REQUIRED: Set the full path to your Claude CLI\nLOG_LEVEL=info                             # Optional: Set log level (e.g., debug, info, warn, error)\n```\n\n**MCP Host Configuration (Recommended for `npx`):**\n\nAdd the following to your MCP Host application settings (e.g., Claude Desktop settings). This method allows you to set environment variables directly.\n\n```json\n    \"claude-code-server\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"@kunihiros/claude-code-mcp\"\n      ],\n      \"env\": {\n        \"CLAUDE_BIN\": \"/path/to/your/claude/executable\", // REQUIRED: Set the absolute path\n        \"LOG_LEVEL\": \"info\"                             // Optional: Set log level\n      },\n      \"disabled\": false\n    }\n```\n*(Restarting the host application might be required.)*\n\n**Alternative MCP Host Configuration (Global Install / Local Dev):**\n\nIf you installed the package globally or are running it locally from the cloned repository, and the `claude-code-mcp` command is in your system's PATH, you can use:\n\n```json\n    \"claude-code-server\": {\n      \"command\": \"claude-code-mcp\",\n      \"disabled\": false\n    }\n```\nIn this case, you **must** configure environment variables using a `.env` file or the global `~/.claude-code-mcp.env` file as described above.\n\n## Environment Variables Details\n\nThis server uses the following environment variables (set via MCP Host `env` settings, `.env`, or `~/.claude-code-mcp.env`):\n\n-   `CLAUDE_BIN`: Specifies the path to the Claude CLI executable. **(Required)**\n    Example: `/home/linuxbrew/.linuxbrew/bin/claude` or `C:\\Users\\YourUser\\AppData\\Local\\bin\\claude.exe`\n-   `LOG_LEVEL`: Specifies the log level. (Optional, defaults to `info`). Possible values: `debug`, `info`, `warn`, `error`.\n\n## Available Tools\n\nThe `claude-code-mcp` server provides the following tools:\n\n- `explain_code`: Provides a detailed explanation of the given code.\n- `review_code`: Reviews the given code.\n- `fix_code`: Fixes bugs or issues in the given code.\n- `edit_code`: Edits the given code based on instructions.\n- `test_code`: Generates tests for the given code.\n- `simulate_command`: Simulates the execution of a given command.\n- `your_own_query`: Sends a custom query with context.\n\n## Note\n\n- Log file (`claude-code-mcp.log`) location:\n    - Attempts to create in the project root first.\n    - Falls back to the user's home directory (`~/.claude-code-mcp.log`).\n    - Finally falls back to `/tmp/claude-code-mcp.log`.\n- Log rotation is not implemented yet (be careful with log file size).\n- Primarily tested with Claude CLI on Ubuntu/WSL2.\n\n## License\n\nThis project is licensed under the MIT License - see below for details.\n\n```\nMIT License\n\nCopyright (c) 2024 KunihiroS\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## Disclaimer\n\nThis software is provided for educational and research purposes only. This project is not officially associated with or endorsed by Anthropic. Claude is a trademark of Anthropic.\n\nThe project uses the Claude CLI as a dependency, but is an independent, community-driven effort. Users should ensure they comply with Anthropic's terms of service when using this project.\n\nThe maintainers of this project are not responsible for any misuse of the software or violations of the terms of service of any third-party APIs or services.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKunihiroS%2Fclaude-code-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKunihiroS%2Fclaude-code-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKunihiroS%2Fclaude-code-mcp/lists"}