mcpnew
mcpnew
默认安全地搭建 MCP 服务器 —— TypeScript 或 JavaScript,预置全部拒绝权限、类型化工具桩和审计钩子。
问题所在
每个手工搭建的 MCP 服务器都是同样的起点:从文档复制一个演示,边做边注册工具,然后祈祷没人问"等等,那个工具能读我的主目录吗?"权限最终在无意中变成全部允许。审计日志是 TODO。输入模式与处理器逐渐脱节。
mcpnew 反转了默认值。你的服务器暴露的每项能力默认拒绝,每次工具调用都经过审计钩子,每个工具桩都在模式层面只类型化一次。
Related MCP server: MCP Server Templates
安装
npm install -g mcpnewcli零运行时依赖。Node 18+。
30 秒快速上手
# 1. Scaffold (JavaScript default; add --lang ts for TypeScript)
mcpnew create my-server && cd my-server && npm install
# 2. Add a typed tool stub — it lands DENIED in mcp.permissions.json
npx mcpnewcli add-tool search-files
# 3. Review, implement, then explicitly allow:
# "tools": { "search-files": "allow" }
# 4. Keep yourself honest
npx mcpnewcli audit就这样。如果清单不再是全部拒绝,如果任何已注册工具缺少 requireAllowed() 门禁,或者审计钩子未接线,mcpnew audit 都会以非零状态退出——把它接入 CI,从构造上保持安全。
接入 CI
把这段放进脚手架生成的服务器仓库中(.github/workflows/audit.yml):
name: mcp-security-audit
on: [push, pull_request]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npx --yes mcpnewcli audit任何发现——放宽的默认值、未加门禁的工具、未接线的钩子——都会以非零状态退出,在合并之前就让检查失败。
你会得到什么
my-server/
├── src/server.js # MCP server: typed tool stubs + permission gates + audit hooks
├── src/audit.js # JSONL audit trail → logs/audit.jsonl (gitignored)
├── src/manifest.js # manifest loader (+ TS types on --lang ts)
├── test/server.test.js # tests asserting the deny-all posture holds
└── mcp.permissions.json # deny-all permission manifest — the source of truth全部拒绝权限 —— 工具、资源、提示词、网络、文件系统:一切默认
deny。通配符直接被拒绝。类型化工具桩 ——
mcpnew add-tool <name>插入一个带 zod 模式、已接好门禁和审计钩子的桩。你只需写函数体;脚手架已经正确。预接线的审计钩子 —— 每次调用都会将时间戳、工具、参数、结果和耗时记录到
logs/audit.jsonl。
配置
生成的 mcp.permissions.json:
{
"version": 1,
"default": "deny",
"tools": { "ping": "deny" },
"resources": { "default": "deny" },
"prompts": { "default": "deny" },
"network": { "default": "deny", "allowlist": [] },
"filesystem": { "default": "deny", "paths": [] }
}在读完工具的功能后,有意识地逐条把条目翻成 "allow"。mcpnew audit 会验证你没有比预期放宽更多。
Pro
要把 MCP 服务器交付给生产团队?mcpnew Pro(每月 $9)增加了策略即代码的审查工作流:权限清单的拉取请求差异,任何 deny 翻成 allow 之前都需要强制签署;组织级审计日志投递(Splunk/Datadog/Loki);以及一份合规报告,把每个工具授权映射到对应的审批记录。单一档位,不按席位计费。通过 Gumroad 授权——链接占位符。
许可证
MIT
属于 stealth-alpha toolkit 的一部分——八个零依赖 CLI,用于发布自动化、代理安全和仓库卫生。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA production-ready MCP server scaffold that features built-in authentication, Docker support, and a comprehensive CI/CD release pipeline. It provides a standardized template for deploying servers with multi-transport support and configurable read-only modes.MIT
- AlicenseNot gradedqualityDmaintenanceProvides production-grade starter templates for MCP servers with permission boundaries, integration tests, and eval contracts, enabling rapid development of secure and testable MCP servers.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProduction-ready MCP server starter with authentication, observability, and a plugin system for building and deploying MCP servers quickly.MIT
- AlicenseNot gradedqualityBmaintenanceA production-ready MCP server template with OAuth 2.1, RBAC, and audit logging for building secure, observable tool servers.MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Scans MCP servers for tool poisoning, prompt injection and supply chain risks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/stealth-alpha/mcpnew'
If you have feedback or need assistance with the MCP directory API, please join our Discord server