Skip to content
Back to search

claude-code-mcp

claude-code-mcp

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/auchenberg--claude-code-mcp/badge.svg)](/listings/auchenberg--claude-code-mcp)

HTML

<a href="/listings/auchenberg--claude-code-mcp"><img src="/api/listings/auchenberg--claude-code-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# Clone the repository
git clone https://github.com/auchenberg/claude-code-mcp.git
cd claude-code-mcp

# Install dependencies
npm install

# Build the project
npm run build

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 305 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Claude Code MCP
  2. Claude Code MCP is an implementation of [Claude Code](https://gist.github.com/transitive-bullshit/487c9cb52c75a9701d312334ed53b20c) as a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server. This project allows you to use Claude Code's powerful software engineering capabilities through the standardized MCP interface.
  3. # ⚠️ DISCLAIMER ⚠️
  4. Claude Code MCP is a auto-generated project by DevinAI, who was prompted to analyse the Claude Code codebase, and generate an MCP server.
  5. This is a proof of concept that I don't advise anyone to use.
  6. ## What is Claude Code?
  7. Claude Code is Anthropic's CLI tool for software engineering tasks, powered by Claude. It provides a set of tools and capabilities that help developers with:
  8. - Code generation and editing
  9. - Code review and analysis
  10. - Debugging and troubleshooting
  11. - File system operations
  12. - Shell command execution
  13. - Project exploration and understanding
  14. The original implementation is available as a JavaScript module that defines prompts and tools for interacting with Claude's API.
  15. ## What is MCP?
  16. The Model Context Protocol (MCP) is a standardized interface for AI models that enables consistent interaction patterns across different models and providers. MCP defines:
  17. - **Tools**: Functions that models can call to perform actions
  18. - **Resources**: External data that models can access
  19. - **Prompts**: Predefined conversation templates
  20. By implementing Claude Code as an MCP server, we make its capabilities available to any MCP-compatible client, allowing for greater interoperability and flexibility.
  21. ## Features
  22. - Full implementation of Claude Code functionality as an MCP server
  23. - Provides tools for file operations, shell commands, and code analysis
  24. - Exposes resources for accessing file system and environment information
  25. - Includes prompts for general CLI interaction and code review
  26. - Compatible with any MCP client
  27. - TypeScript implementation with full type safety
  28. ## Installation
  29. ```bash
  30. # Clone the repository
  31. git clone https://github.com/auchenberg/claude-code-mcp.git
  32. cd claude-code-mcp
  33. # Install dependencies
  34. npm install
  35. # Build the project
  36. npm run build
  37. ```
  38. ## Usage
  39. ### Running as a standalone server
  40. ```bash
  41. # Start the server
  42. npm start
  43. ```
  44. ### Using with MCP clients
  45. Claude Code MCP can be used with any MCP client. Here's an example of how to connect to it using the MCP TypeScript SDK:
  46. ```typescript
  47. import { Client } from "@modelcontextprotocol/sdk/client/index.js";
  48. import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
  49. const transport = new StdioClientTransport({
  50. command: "node",
  51. args: ["dist/index.js"]
  52. });
  53. const client = new Client(
  54. {
  55. name: "example-client",
  56. version: "1.0.0"
  57. },
  58. {
  59. capabilities: {
  60. prompts: {},
  61. resources: {},
  62. tools: {}
  63. }
  64. }
  65. );
  66. await client.connect(transport);
  67. // Use Claude Code through MCP
  68. const result = await client.callTool({
  69. name: "bash",
  70. arguments: {
  71. command: "ls -la"
  72. }
  73. });
  74. console.log(result);
  75. ```
  76. ## Available Tools
  77. Claude Code MCP provides the following tools:
  78. - **bash**: Execute shell commands with security restrictions and timeout options
  79. - **readFile**: Read files from the filesystem with options for line offsets and limits
  80. - **listFiles**: List files and directories with detailed metadata
  81. - **searchGlob**: Search for files matching a glob pattern
  82. - **grep**: Search for text in files with regex pattern support
  83. - **think**: A no-op tool for thinking through complex problems
  84. - **codeReview**: Analyze and review code for bugs, security issues, and best practices
  85. - **editFile**: Create or edit files with specified content
  86. ### Tool Details
  87. #### bash
  88. ```typescript
  89. {
  90. command: string; // The shell command to execute
  91. timeout?: number; // Optional timeout in milliseconds (max 600000)
  92. }
  93. ```
  94. The bash tool includes security restrictions that prevent execution of potentially dangerous commands like `curl`, `wget`, and others.
  95. #### readFile
  96. ```typescript
  97. {
  98. file_path: string; // The absolute path to the file to read
  99. offset?: number; // The line number to start reading from
  100. limit?: number; // The number of lines to read
  101. }
  102. ```
  103. #### searchGlob
  104. ```typescript
  105. {
  106. pattern: string; // The glob pattern to match files against
  107. path?: string; // The directory to search in (defaults to current working directory)
  108. }
  109. ```
  110. #### grep
  111. ```typescript
  112. {
  113. pattern: string; // The regular expression pattern to search for
  114. path?: string; // The directory to search in (defaults to current working directory)
  115. include?: string; // File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}")
  116. }
  117. ```
  118. ## Available Resources
  119. - **file**: Access file contents (`file://{path}`)
  120. - Provides direct access to file contents with proper error handling
  121. - Returns the full text content of the specified file
  122. - **directory**: List directory contents (`dir://{path}`)
  123. - Returns a JSON array of file information objects
  124. - Each object includes name, path, isDirectory, size, and modified date
  125. - **environment**: Get system environment information (`env://info`)
  126. - Returns information about the system environment
  127. - Includes Node.js version, npm version, OS info, and environment variables
  128. ## Available Prompts
  129. - **generalCLI**: General CLI prompt for Claude Code
  130. - Provides a comprehensive system prompt for Claude to act as a CLI tool
  131. - Includes guidelines for tone, style, proactiveness, and following conventions
  132. - Automatically includes environment details
  133. - **codeReview**: Prompt for reviewing code
  134. - Specialized prompt for code review tasks
  135. - Analyzes code for bugs, security vulnerabilities, performance issues, and best practices
  136. - **prReview**: Prompt for reviewing pull requests
  137. - Specialized prompt for PR review tasks
  138. - Analyzes PR changes and provides comprehensive feedback
  139. - **initCodebase**: Initialize a new CLAUDE.md file with codebase documentation
  140. - Creates documentation for build/lint/test commands and code style guidelines
  141. - Useful for setting up a new project with Claude Code
  142. ## Development
  143. ```bash
  144. # Run in development mode with auto-reload
  145. npm run dev
  146. ```
  147. ## Architecture
  148. Claude Code MCP is built with a modular architecture:
  149. ```
  150. claude-code-mcp/
  151. ├── src/
  152. │ ├── server/
  153. │ │ ├── claude-code-server.ts # Main server setup
  154. │ │ ├── tools.ts # Tool implementations
  155. │ │ ├── prompts.ts # Prompt definitions
  156. │ │ └── resources.ts # Resource implementations
  157. │ ├── utils/
  158. │ │ ├── bash.ts # Shell command utilities
  159. │ │ └── file.ts # File system utilities
  160. │ └── index.ts # Entry point
  161. ├── package.json
  162. ├── tsconfig.json
  163. └── README.md
  164. ```
  165. The implementation follows these key principles:
  166. 1. **Modularity**: Each component (tools, prompts, resources) is implemented in a separate module
  167. 2. **Type Safety**: Full TypeScript type definitions for all components
  168. 3. **Error Handling**: Comprehensive error handling for all operations
  169. 4. **Security**: Security restrictions for potentially dangerous operations
  170. ## Implementation Details
  171. ### MCP Server Setup
  172. The main server is set up in `claude-code-server.ts`:
  173. ```typescript
  174. export async function setupClaudeCodeServer(server: McpServer): Promise<void> {
  175. // Set up Claude Code tools
  176. setupTools(server);
  177. // Set up Claude Code prompts
  178. setupPrompts(server);
  179. // Set up Claude Code resources
  180. setupResources(server);
  181. }
  182. ```
  183. ### Tool Implementation
  184. Tools are implemented using the MCP SDK's tool registration method:
  185. ```typescript
  186. server.tool(
  187. "toolName",
  188. "Tool description",
  189. {
  190. // Zod schema for tool arguments
  191. param1: z.string().describe("Parameter description"),
  192. param2: z.number().optional().describe("Optional parameter description")
  193. },
  194. async ({ param1, param2 }) => {
  195. // Tool implementation
  196. return {
  197. content: [{ type: "text", text: "Result" }]
  198. };
  199. }
  200. );
  201. ```
  202. ### Resource Implementation
  203. Resources are implemented using the MCP SDK's resource registration method:
  204. ```typescript
  205. server.resource(
  206. "resourceName",
  207. new ResourceTemplate("resource://{variable}", { list: undefined }),
  208. async (uri, variables) => {
  209. // Resource implementation
  210. return {
  211. contents: [{
  212. uri: uri.href,
  213. text: "Resource content"
  214. }]
  215. };
  216. }
  217. );
  218. ```
  219. ## License
  220. MIT
  221. ## Acknowledgements
  222. - [Claude Code](https://gist.github.com/transitive-bullshit/487c9cb52c75a9701d312334ed53b20c) by Anthropic
  223. - [Model Context Protocol](https://modelcontextprotocol.io)
  224. - [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
  225. ## Contributing
  226. Contributions are welcome! Please feel free to submit a Pull Request.
  227. ## Disclaimer
  228. This project is not officially affiliated with Anthropic. Claude Code is a product of Anthropic, and this project is an independent implementation of Claude Code as an MCP server.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.