Mcp Devtools

io.github.marin1321由 GitHub 账号 marin1321 发布v1.0.1更新于 Oct 24, 2026

MCP server giving AI agents safe access to filesystem, databases, processes, and APIs.

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手在限定范围内访问开发环境中的文件、数据库、进程和 API。

可以做什么
  • 在配置范围内读取、写入、列出、搜索和查看文件信息
  • 查询数据库、列出数据表并查看表结构
  • 执行白名单内的命令、读取日志、列出进程并读取环境变量
  • 解析 OpenAPI 规范,并仅向规范声明的服务器地址发起 API 调用
  • 提供只读资源(工具目录、服务器信息)以及调试、代码审查、代码库探索和重构的提示模板
  • 通过插件 API 加载自定义工具
适用场景
适合让助手直接操作本地项目:查看和修改文件、查询开发数据库、运行获准的命令,或调用由 OpenAPI 规范描述的接口,并以范围限制和审计日志替代不受限的 shell 访问。
运行要求
通过 npx 以 stdio 在本地运行(需要 Node.js),或通过 HTTP 在可配置端口上运行。配置来自 mcp-devtools.json、.mcp-devtoolsrc 或 package.json 中的键,也支持零配置默认值。HTTP 模式可通过环境变量(如 MCP_AUTH_TOKEN)提供 Bearer 令牌。数据库访问需在配置中填写连接信息。
安装前请注意
它可以写文件、执行命令和调用外部 API,使用前应配置好范围、命令白名单和数据库只读模式。get_env 会暴露环境变量,仅对名称类似密钥的变量做掩码。HTTP 模式若未配置令牌则无鉴权。审计日志需手动开启,插件会在启动时执行任意代码。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Devtools,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-devtools

[npm version] [CI] [License: MIT] [Node.js]

AI-native developer tools via Model Context Protocol. A production-grade MCP server that gives AI agents (Claude, Cursor, Copilot, Continue, ...) safe, scoped access to your local development environment.

Why

The MCP ecosystem is full of single-purpose tutorials and vendor-locked adapters. There is no well-maintained, multi-tool, framework-agnostic, production-quality MCP package for everyday developer tooling.

mcp-devtools fills that gap with 14 tools, 3 MCP Resources, 4 MCP Prompts, a Plugin API, two transport modes (stdio + HTTP with auth), and an audit log — built on patterns refined in production at DailyBot.

Quick start

stdio (default)

bash
npx @oscarmarin/mcp-devtools

Add it to Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "devtools": {      "command": "npx",      "args": ["-y", "@oscarmarin/mcp-devtools"]    }  }}

Or Cursor (~/.cursor/mcp.json): same block.

HTTP transport

Create a mcp-devtools.json in your project root:

json
{  "transport": "http",  "port": 3333,  "auth": {    "token": "env:MCP_AUTH_TOKEN"  }}

Then start the server:

bash
npx @oscarmarin/mcp-devtools

The MCP endpoint will be available at http://localhost:3333.

Tools

GroupTools
Filesystemread_file, write_file, list_directory, search_files, get_file_info
Databasequery_db, list_tables, describe_table
Processrun_command, read_logs, get_env, list_processes
OpenAPIparse_openapi, call_api

Per-tool reference: docs/tools/.

MCP Resources

The server exposes read-only data via MCP Resources:

URIDescription
devtools://toolsCatalog of all registered tools with schemas
devtools://server-infoServer version, transport, scope, tool count

MCP Prompts

Curated prompt templates for common development workflows:

PromptDescription
debug_errorSystematically debug an error using mcp-devtools tools
code_reviewReview a file for bugs, security issues, and code quality
explore_codebaseExplore and understand a project's structure and conventions
refactor_functionRefactor a function for readability, performance, or testability

Plugin API

Extend mcp-devtools with custom tools — no fork required.

Config-based (load at startup):

json
{  "plugins": ["./my-tools.js", "@scope/mcp-plugin-foo"]}

Each plugin module default-exports an array of tool definitions:

typescript
import { defineTool } from "@oscarmarin/mcp-devtools";import { z } from "zod";
export default [  defineTool({    name: "my_tool",    description: "Does something useful",    inputSchema: z.object({ input: z.string() }),    handler: async (args, config) => ({      ok: true,      data: { result: args.input.toUpperCase() },    }),  }),];

Configuration

Configuration is loaded by cosmiconfig from mcp-devtools.json, .mcp-devtoolsrc, or the mcpDevtools key in package.json. See mcp-devtools.example.json and docs/configuration.md for the full schema.

Zero-config is supported: running npx @oscarmarin/mcp-devtools with no config uses schema defaults (RNF-05).

Security

Four non-bypassable controls:

  1. Filesystem scope boundary. Every path is resolved to an absolute and compared against config.scope. Symlinks that escape scope throw SCOPE_VIOLATION.
  2. Command allowlist. run_command only executes binaries whose basename is in allowedCommands. Invocation uses spawn(file, args) (no shell), so shell-injection via the command argument is structurally impossible.
  3. Database read-only mode. When readOnly: true, all SQL is parsed and INSERT/UPDATE/DELETE/DROP/CREATE/GRANT are rejected. Queries run in BEGIN READ ONLY ... ROLLBACK on PostgreSQL.
  4. HTTP Bearer auth. When auth.token is configured, every HTTP request must include Authorization: Bearer <token>. Comparison uses crypto.timingSafeEqual to prevent timing attacks.

Additional safety measures:

  • Audit log. Opt-in NDJSON log of every tool invocation with timing, sanitized inputs, and result status.
  • Secret masking. get_env automatically masks values matching common secret patterns (SECRET, TOKEN, PASSWORD, KEY, etc.).
  • OpenAPI host restriction. call_api only sends requests to hosts listed in the spec's servers array.
  • Output capping. All tools cap their output to prevent context flooding (100KB for commands, 1MB for files, 200 rows for queries).

Contributing

bash
git clone https://github.com/marin1321/mcp-devtools.gitcd mcp-devtoolsnpm installnpm run dev       # tsup --watchnpm run test      # vitestnpm run typecheck # tsc --noEmitnpm run lint      # eslint .

See CONTRIBUTING.md for the full workflow and CODE_OF_CONDUCT.md for community guidelines.

License

MIT © Oscar Humberto Marin Molina — oscarmarindev.com

来源:README.md,提交 5d4e8d6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分