secureFlows MCP Server
Cloud-deployable MCP server exposing secureFlows' OpenAPI operations (tagged ai-safe/ai-optional) as MCP tools, plus static helper tools like login URL building and integration linting for coding agents.
README
secureFlows MCP Server
Cloud-deployable MCP server that wraps the secureFlows OpenAPI
surface tagged ai-safe and ai-optional.
This repo is a public mirror, published periodically from the private secureFlows monorepo where development actually happens. Issues and PRs are welcome; large changes may take a release cycle to land upstream first.
What is an MCP server?
An MCP server is a small HTTP service that exposes a set of “tools” an AI client can call in a standard way.
In this repo:
- The secureFlows MCP server exposes tools that are auto-generated from your OpenAPI YAML specs.
- When a client calls a tool, the MCP server forwards the call to your real secureFlows backend (
connection.host) and returns the response in a normalized tool result.
This lets an AI client:
- discover available secureFlows operations via
listTools - call them via
callTool - without hardcoding the API surface or manual auth/header wiring
What it does
Two kinds of tools, registered together in src/server.ts:
Generated tools (src/tools/build-tools.ts) — one per OpenAPI operation:
- Loads:
docs/openapi/session/secure-flows-session-api.yamldocs/openapi/user/secure-flows-user-api.yamldocs/openapi/docs/secure-flows-docs-api.yaml
- Exposes only operations tagged
ai-safeorai-optionalas MCP tools - Forwards requests to a caller-provided secureFlows host — a thin, generic HTTP wrapper with no
secureFlows-specific judgment. Every one of these requires a live
auth.*token, so they're only useful once a session already exists (see Runtime model below). - Maps secureFlows auth headers from MCP tool inputs:
auth.firebaseTokenauth.sessionTokenauth.userToken
Static tools (src/tools/static-tools.ts) — hand-written, not generated from the spec:
-
secureflows_build_login_url/secureflows_build_logout_url— build the hosted-login and redirect-logout URLs correctly by construction (always/app/sessions/login, never the legacy/app/login; refuses a post-logoutredirect_urithat points at/callbackor leakssession_token). No secureFlows token required. -
secureflows_lint_integration— checks generated app source against the integration rules and reports structured findings instead of leaving them as prose the agent has to self-police. No secureFlows token required. Two kinds of finding:scope: "file"— a forbidden construct is present, at an exactfile:line: env-var config constants, token inlocalStorage, legacy/app/login,fetch/XHR logout, client-side JWT decode, revoke-on-sign-out, emptycatch {}, restoresetSession(null)on non-auth errors, Continue CTA gated onsession === null, …scope: "project"— required handling is absent across every file passed in: detecting401/410but never clearing the token, never handling403, or handling403without theBILLING_GRACE_LOCKcarve-out.
The absence checks exist because the pattern rules structurally could not catch the defect class that dominates real generated apps. Measured: on a real trial's app that the eval harness's LLM judge scored 4/10 — citing "stale token never cleared on signed-out", "403 variants unhandled", "no error handling" — the pattern rules alone produced zero findings, because every one of those bugs is an absence, and a regex can only see what is present. With the absence checks it produces 3, including the
error-severity token-clearing one. Both check kinds are validated against the canonicaltemplates/web-app-secureflowsstarter, which must stay at zero findings.Still heuristic text analysis, not a parser or type checker: it misses what it has no rule for, a project check can be satisfied by the right keyword in the wrong place, and it cannot cover the checks that need a running app (auth-guard mount races, the fresh-reload check). A fast first pass — not a replacement for the Agent implementation checklist in SKILL.md.
These static tools exist because the generated tools can't help with the part of an integration that happens before a session exists — scaffolding the redirect/callback/token-lifecycle code — which is exactly where most secureFlows integration mistakes happen.
Uses a stateless HTTP MCP transport, so the server does not persist tenant config or secrets.
Runtime model
Each tool call receives:
connection.host: secureFlows base URLconnection.workspaceName: optional default workspaceconnection.appId: optional default application idauth.*: whichever token the selected endpoint needs
workspaceName and appId are treated as stable app config. The server injects them into known secureFlows request shapes when omitted by the caller.
For agents (the only supported client path)
Point the MCP client at the hosted URL — same host as the product, path /mcp (not a subdomain):
| Environment | MCP URL |
|---|---|
| Production | https://www.secure-flows.com/mcp |
| Staging | https://secure-flows-staging.onrender.com/mcp |
| Health | …/mcp/health → {"ok":true} |
{
"mcpServers": {
"secureflows": {
"url": "https://www.secure-flows.com/mcp"
}
}
}
Do not tell agents to run npx or use localhost — that splits the story and breaks anyone who never starts a local process. Wired in the web Docker image (Node on 127.0.0.1:8787, nginx location = /mcp; see docs/ROUTING.md). The Node process installs uncaughtException / unhandledRejection guards so a single bad request does not exit the process; docker/entrypoint.sh also restarts MCP if the process still exits.
Local development (maintainers of this package)
cd mcp-server
npm install
npm run build
npm test
npm run dev
The server starts on http://0.0.0.0:8787 by default (POST /mcp, GET /health). This is for
changing the MCP server itself — not the path product agents should configure.
Environment variables
PORT: HTTP port, default8787(in the web container, entrypoint setsPORT=8787only for the MCP child so nginx keeps Render’s public$PORT)HOST: bind host, default0.0.0.0(web container uses127.0.0.1)ALLOWED_HOSTS: optional comma-separated host allowlist for MCP host header validationMCP_ALLOWED_HOSTS: entrypoint override forALLOWED_HOSTSwhen starting the in-image process
Endpoints
POST /mcp: MCP Streamable HTTP endpointGET /health: health check (publicly exposed asGET /mcp/healthvia nginx)
Embedding secureFlows in an application
Product apps integrate directly with secureFlows HTTP APIs and hosted login. Start from:
docs/integration/quickstart.md— provisioning (workspace + application) and runtime hosted logindocs/integration/CONCEPT.md— baseline order: login → create workspace before advanced featuresdocs/openapi/integration-auth.yaml—/app/sessions/login(session apps) vs/app/login(legacy/console)
Product apps still integrate directly with the HTTP APIs above, not through this server. The
generated tools here are for agents/automation that already have a token (testing, scripted
verification). The static tools (secureflows_build_login_url, secureflows_build_logout_url,
secureflows_lint_integration) need no token and are meant to be called by a coding agent while
it's still scaffolding the integration — see What it does above.
Testing this MCP server
npm testinmcp-server/— unit tests plus HTTP smoke (test/http-smoke.test.ts): starts the Express app on an ephemeral port, checksGET /health,GET /mcp→ 405, and a real Streamable-HTTP clientlistTools+callTool(secureflows_build_login_url).- After deploy: Playwright
tests/smoke/mcp-health.spec.tshits publicGET /mcp/healthandGET /mcpon the target host (production smoke job). - Local maintainer loop:
npm run dev, thencurl -sS http://127.0.0.1:8787/health. - Optional: MCP client against
POST /mcpwithconnection.host+auth.*for generated tools.
Deployment
Shipped inside the web Docker image and proxied at /mcp on www.secure-flows.com / staging
(see For agents above). No separate subdomain.
The npm package secureflows-mcp-server is how CI publishes a versioned artifact (and how a
standalone container can be built from mcp-server/Dockerfile); it is not the agent-facing
setup path. Publish on v*.*.* tags via .github/workflows/publish-secureflows-mcp-server.yml.
docker build -f mcp-server/Dockerfile -t secureflows-mcp-server .
docker run --rm -p 8787:8787 secureflows-mcp-server
Notes
- Hosted login / redirect endpoints are exposed only if they are tagged
ai-safeorai-optionalin the OpenAPI specs. - Documentation search (
get_docs_search) isai-safe, requires noauth.*— onlyconnection.hostand queryq. - Human-only admin console APIs are intentionally excluded.
- The response payload from each tool includes:
statusokurlheadersdata
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。