MCP Server Template 2a33a25d

MCP安全风控

提供方 MeasureBit

安全风控 stdio · 本地进程 OAuth 授权 社区 / 第三方 Claude DesktopClaude
查看接入方式

一个生产就绪的MCP服务器模板,提供完整的认证基础设施,适用于多项目范围和组织白标化场景。

一句话选型结论

按资料字段整理

MCP Server Template 2a33a25d 属于安全风控类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude Desktop、Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类安全风控 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

安全风控
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

认证服务Python本地部署OAuth2.0JWTAPI管理Supabase集成

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
pip install -r requirements.txt

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
资产与漏洞排查

盘点资产、扫漏洞、看暴露面。

日志与审计

汇总日志、查异常行为。

合规检查

按规则检查配置与权限是否合规。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在安全风控场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Server Template 2a33a25d当前 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Cyber Strike AI 75 未标注 未标注 无 2026-05-17
mcp-for-beginners 未标注 stdio · 本地进程 本地部署 有 2026-04-13
casdoor 未标注 stdio · 本地进程 本地部署 有 2026-04-12
kubeshark 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Modelcontextprotocol C22988b0 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

安全风控
字段来自项目仓库与公开索引,中文说明由本站标注
提供方MeasureBit上游标注的维护方 MeasureBit
分类安全风控本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

7.4 KB
来自项目仓库与上游目录的原文,未做删改

MCP Server Template

Production-ready MCP server template with full authentication infrastructure, extracted from a battle-tested production deployment.

Features

  • OAuth 2.0 + PKCE — Full authorization code flow with S256 code challenge
  • Auto-authorize — Known emails skip the login form automatically
  • Refresh tokens — 7-day refresh tokens with JWT rotation
  • Client credentials — Machine-to-machine auth via client_secret_post or client_secret_basic
  • Supabase API key validation — Cached key lookups with configurable TTL
  • Multi-project scoping — allowed_projects per key restricts access across MCP deployments
  • Organization whitelabeling — CNAME-based branding (custom name, favicon) resolved from Host header
  • Usage tracking — Per-key request counts and token usage persisted to Supabase
  • Resilient fallback — Configurable behavior when Supabase is unreachable (deny/allow/env)
  • Dev/prod table separation — ENV=dev uses api_keys_dev/usage_dev tables
  • Static file serving — Serve branding assets (favicons, logos) from /static/
  • Health check — GET /health returns {"status": "ok"}

Quick Start

  1. Install dependenciesbash pip install -r requirements.txt

  2. Configure environmentbash cp .env.example .env # Edit .env with your Supabase credentials and PROJECT_ID

  3. Set up database — Run the SQL migrations in order against your Supabase project:migrations/000_base_tables.sql # API keys + usage tables migrations/001_organizations.sql # Organizations (optional, for whitelabeling)

  4. Add your tools — Edit server.py and replace the echo example with your own @mcp.tool decorated functions.

  5. Run```bash
    # Streamable HTTP (production)
    TRANSPORT=http python server.py

# stdio (local development / Claude Desktop)
python server.py
```

Project Structure

File Purpose
server.py Entry point + your MCP tools (edit this)
auth.py Auth middleware — OAuth, JWT, API keys, orgs (don't edit)
tracking.py Token/usage tracking via contextvars (don't edit)
requirements.txt Python dependencies
Dockerfile Container deployment
.env.example All configuration variables documented
migrations/ SQL migrations for Supabase tables
static/ Branding assets (favicon, logo)

Server Instructions (LLM Guidance)

The instructions parameter on FastMCP() is the most important way to control how LLMs use your server. It's returned during the MCP initialization handshake and tells the LLM everything it needs to know — no external skill files or documentation required.```python
mcp = FastMCP(
"my_server",
instructions="""My server does X. Use tool_a for quick checks, tool_b for deep analysis.

Workflow

  1. tool_a — start here for fast results
  2. tool_b — use after tool_a when the user wants more detail

Before calling any tool

Always ask the user for: their input data, preferred format, and any constraints.

Presenting results

Lead with the key metric. Show supporting detail after. Never dump raw JSON.

Important

  • Never call tool_b without calling tool_a first.
  • Reuse results from earlier calls — don't repeat work.
    """
    )

**What to include:**
- **Workflow** — which tools to call in what order
- **Prerequisites** — what to collect from the user before calling tools
- **Output rules** — how to format and present results
- **Constraints** — gotchas, ordering requirements, things to avoid
- **Panel/state reuse** — when to reuse previous results vs. making new calls

**What NOT to include:**
- Internal implementation details (model names, scoring methodology)
- API keys or credentials
- Anything you wouldn't want shown to an end user

## Adding Tools

Add tools to `server.py` using the `@mcp.tool` decorator:```python
@mcp.tool(
    name="my_tool",
    annotations={
        "title": "My Tool",
        "readOnlyHint": True,
        "destructiveHint": False,
        "idempotentHint": True,
        "openWorldHint": False,
    },
)
async def my_tool(input_text: str, option: str = "default") -> str:
    """Description of what this tool does.

    Args:
        input_text: The main input.
        option: An optional parameter.

    Returns:
        The tool's output.
    """
    # Your logic here
    return result

For tools that call LLMs and want token tracking:```python
from tracking import track_tokens

@mcp.tool(name="my_llm_tool")
async def my_llm_tool(prompt: str) -> str:
"""A tool that calls an LLM."""
response = await my_llm_call(prompt)
await track_tokens(response.input_tokens, response.output_tokens)
return response.text


## Authentication Flow

1. Client discovers OAuth metadata at `/.well-known/oauth-authorization-server`
2. Client redirects to `/authorize` with PKCE parameters
3. If `client_id` is a known email, auto-redirects with auth code (no form)
4. Otherwise, user sees login form (email + API key)
5. Client exchanges auth code for tokens at `/token`
6. Access token (JWT, 30min) used as `Bearer` token on `/mcp`
7. Refresh token (JWT, 7 days) used to get new access tokens

## Organization Whitelabeling

To set up whitelabeled instances:

1. Run `migrations/001_organizations.sql`
2. Insert an organization:```sql
   INSERT INTO organizations (slug, brand_name, favicon_url, cname_domain)
   VALUES ('acme', 'Acme Corp MCP', '/static/acme-favicon.png', 'mcp.acme.com');
   ```
3. Set up a CNAME record: `mcp.acme.com` → your deployment URL
4. Place `acme-favicon.png` in `static/`
5. API keys with matching `organization_id` will see Acme branding

## Configuration Reference

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `SUPABASE_URL` | Yes | — | Supabase project URL |
| `SUPABASE_KEY` | Yes | — | Supabase anon or service role key |
| `PROJECT_ID` | Yes | — | Unique ID for this MCP project |
| `TRANSPORT` | No | `stdio` | `http` for streamable HTTP, `stdio` for local |
| `PORT` | No | `8000` | HTTP port (when TRANSPORT=http) |
| `ENV` | No | `prod` | `dev` uses `_dev` table variants |
| `JWT_SECRET` | No | auto-generated | Secret for signing JWTs |
| `JWT_EXPIRY` | No | `1800` | Access token expiry in seconds |
| `SUPABASE_FALLBACK` | No | `deny` | `deny`/`allow`/`env` when Supabase unreachable |
| `API_KEYS` | No | — | Comma-separated keys (fallback=env only) |
| `BLOCKED_KEYS` | No | — | Comma-separated blocked keys (fallback=env only) |

## Deployment

### Docker```bash
docker build -t my-mcp .
docker run -p 8000:8000 --env-file .env my-mcp

Railway

  1. Connect your repo
  2. Set environment variables in Railway dashboard
  3. Railway auto-detects the Dockerfile

Endpoints

Endpoint Method Auth Description
/health GET No Health check
/.well-known/oauth-authorization-server GET No OAuth metadata
/.well-known/oauth-protected-resource GET No Protected resource metadata
/authorize GET/POST No OAuth authorization (login form)
/token POST No Token exchange
/register POST No Client registration (returns disabled)
/mcp POST/DELETE Yes MCP streamable HTTP endpoint
/ POST/DELETE Yes Alias for /mcp
/usage GET admin_key Usage statistics
/static/* GET No Static assets

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
MCP Server Template 2a33a25d 怎么安装?

在客户端按下面的安装命令接入:pip install -r requirements.txt。装完在客户端配置里引用同一个包或端点。

MCP Server Template 2a33a25d 怎么在 Claude Desktop、Claude 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

MCP Server Template 2a33a25d 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Server Template 2a33a25d 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

MCP Server Template 2a33a25d 支持哪些客户端?

资料标注支持 Claude Desktop、Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

MCP Server Template 2a33a25d 能提供哪些能力?

资料显示能力标签包括 认证服务、API集成、Python、Claude。具体工具清单以官方文档为准。

MCP Server Template 2a33a25d 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

MCP Server Template 2a33a25d 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。