dev-tools

dev-tools

Enables coding agents to run Playwright e2e tests, validate Supabase RLS policies with role-based SQL, typecheck TypeScript, execute npm scripts with parsed test output, and validate Next.js builds, all through a structured MCP interface.

Category
访问服务器

README

dev-tools-mcp

CI License: MIT

An MCP (Model Context Protocol) stdio server that gives Claude Code — or any MCP client — five structured development tools:

# Tool What it does
1 run_e2e_tests Runs Playwright tests, starts the dev server, returns pass/fail per test
2 execute_sql_as_role Executes SQL as a Postgres role with JWT claims — verifies Supabase RLS
3 typecheck Runs tsc --noEmit, returns structured errors (file, line, code, message)
4 npm_run Runs any npm script, parses Vitest/Jest output into structured results
5 nextjs_build Runs next build, returns structured errors + page list with sizes

Prerequisites

  • Node.js ≥ 18
  • Claude Code installed
  • For the RLS tool: psql on your PATH and a running Supabase/Postgres instance

Quick start

# 1. Clone the repo
git clone https://github.com/briancox730/dev-tools-mcp.git
cd dev-tools-mcp

# 2. Install dependencies
npm install

# 3. Build
npm run build

# 4. Register with Claude Code (local scope — this project only)
claude mcp add --transport stdio dev-tools -- node /absolute/path/to/dev-tools-mcp/build/index.js

# OR register globally (available in all projects)
claude mcp add --transport stdio --scope user dev-tools -- node /absolute/path/to/dev-tools-mcp/build/index.js

Alternative: edit .claude.json directly

Add this to the mcpServers key in ~/.claude.json (global) or .claude.json in your project root:

{
  "mcpServers": {
    "dev-tools": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/dev-tools-mcp/build/index.js"]
    }
  }
}

Then restart Claude Code.

Verify it's working

Inside Claude Code, run /mcp — you should see dev-tools: connected with 5 tools listed.

Tool details

1. run_e2e_tests — Playwright E2E runner

Runs Playwright with the JSON reporter and parses results into structured output.

Inputs:

  • project_dir (required) — absolute path to your project
  • test_pattern — glob or file path to filter, e.g. "tests/auth.spec.ts"
  • headed — run in headed mode (default: false)
  • start_server — use Playwright's webServer config (default: true)
  • timeout_seconds — kill after this many seconds (default: 120)

What you get back:

{
  "success": true,
  "summary": { "passed": 8, "failed": 1, "skipped": 0, "total": 9 },
  "tests": [
    { "name": "Auth > should redirect unauthenticated users", "status": "passed", "duration_ms": 1200 },
    { "name": "Auth > should show dashboard after login", "status": "failed", "duration_ms": 3400, "error": "Expected element to be visible..." }
  ]
}

Tip: Make sure your playwright.config.ts has a webServer section so Playwright auto-starts your dev server:

export default defineConfig({
  webServer: {
    command: 'npm run dev',
    port: 3000,
    reuseExistingServer: !process.env.CI,
  },
});

2. execute_sql_as_role — Supabase RLS tester

Executes SQL as a specific Postgres role with JWT claims, then rolls back. Never mutates data.

Inputs:

  • connection_string (required) — e.g. "postgresql://postgres:postgres@localhost:54322/postgres"
  • sql (required) — the query to run
  • role — Postgres role (default: "authenticated")
  • user_id — UUID set as auth.uid()
  • claims — additional JWT claims, e.g. { "app_role": "parent" }

Example prompt for Claude Code:

"Run SELECT * FROM children as an authenticated parent user with id abc-123 and confirm they can only see their own children."

What you get back:

{
  "success": true,
  "role": "authenticated",
  "user_id": "abc-123",
  "query": "SELECT * FROM children",
  "rows": [["id-1", "abc-123", "Alice"], ["id-2", "abc-123", "Bob"]],
  "row_count": 2
}

3. typecheck — TypeScript checker

Runs tsc --noEmit and parses the output into structured errors.

Inputs:

  • project_dir (required)
  • tsconfig — relative path to tsconfig (default: "tsconfig.json")
  • files — check only specific files

What you get back:

{
  "success": false,
  "error_count": 2,
  "errors": [
    { "file": "src/utils.ts", "line": 42, "column": 5, "code": "TS2345", "message": "Argument of type 'string' is not assignable..." },
    { "file": "src/api.ts", "line": 18, "column": 12, "code": "TS2339", "message": "Property 'foo' does not exist on type..." }
  ]
}

4. npm_run — Structured npm script runner

Runs any npm script with CI=true and FORCE_COLOR=0, then parses Vitest/Jest output.

Inputs:

  • project_dir (required)
  • script (required) — e.g. "test", "test:unit", "lint"
  • args — extra args passed after --
  • env — extra environment variables

What you get back:

{
  "success": false,
  "exit_code": 1,
  "script": "test",
  "summary": { "total_tests": 14, "passed_tests": 12, "failed_tests": 2 },
  "file_results": [
    { "file": "src/auth.test.ts", "status": "failed", "tests_failed": 2 },
    { "file": "src/utils.test.ts", "status": "passed", "tests_passed": 5 }
  ],
  "raw_stdout": "..."
}

5. nextjs_build — Next.js build validator

Runs next build in production mode and parses errors and page output.

Inputs:

  • project_dir (required)
  • env — extra env vars for the build
  • timeout_seconds — (default: 180)

What you get back:

{
  "success": true,
  "error_count": 0,
  "errors": [],
  "pages": [
    { "path": "/", "size_kb": 5.42, "type": "static" },
    { "path": "/dashboard", "size_kb": 12.1, "type": "dynamic" },
    { "path": "/api/auth", "size_kb": 0, "type": "ssr" }
  ],
  "build_duration_ms": 24500
}

Development

# Watch mode
npm run watch

# Run the unit tests (Vitest)
npm test

# Test interactively with the MCP Inspector
npm run inspect

Tests

The output parsers are the trickiest, most regression-prone part of the codebase — they turn free-form Vitest/Jest/tsc/next build console output into structured JSON. Those pure functions are unit-tested with Vitest under test/; run them with npm test. CI (see .github/workflows/ci.yml) runs npm ci, the TypeScript build, and the test suite on Node 20 and 22 for every push and pull request.

Customization ideas

  • Add a lint tool that parses ESLint JSON output
  • Add a prisma_migrate tool for structured migration status
  • Add a docker_compose tool to manage test containers
  • Wire the RLS tool to Supabase CLI (supabase db test) instead of raw psql

License

MIT © 2026 Brian Cox

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选