mcp-crm
mcp-crm
一个学习项目:一个基于 stdio 向 MCP 客户端暴露 CRM 的 Model Context Protocol 服务器。
登录通过 Microsoft Entra 使用设备码流程完成。生成的身份令牌会交换为 CRM 访问令牌,因此 CRM 查询会以已登录用户的身份运行,并且只返回该用户有权查看的内容。
要求
Node.js 20+
一个已启用设备码(公共客户端)流程的 Entra 应用注册
一个可在
POST /api/auth/entra接受 Entra 令牌,并在GET /api/accounts提供数据的 CRM API
Related MCP server: M365 Copilot Web Bridge
设置
npm install在项目根目录创建 .env 文件:
ENTRA_CLIENT_ID=<your app registration's client id>
ENTRA_TENANT_ID=<your directory tenant id>
CRM_API_BASE_URL=https://your-crm.example.com以下三项都是必需的——服务器启动时若缺少任何一项都会抛出异常。.env 已被 gitignore;切勿提交它。
运行
npx tsx src/index.ts # run directly
npx tsc # type-check and build to dist/服务器通过 stdio 进行 MCP 协议通信,因此通常由客户端启动,而不是手动运行。要将其注册到 Claude Code:
{
"mcpServers": {
"crm": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/mcp-crm/src/index.ts"]
}
}
}日志输出进入 stderr,因为 stdout 承载着 MCP 协议。
工具
工具 | 说明 |
| 开始 Entra 设备码登录,并返回需要访问的验证码和 URL。该调用会立即返回;登录在后台完成。 |
| 报告那一次登录是否已完成、仍在等待,还是已失败。 |
| 按名称搜索真实 CRM 账户。需要先完成登录。最多返回 25 条匹配结果,包含 |
| 在一个小型硬编码示例账户列表中搜索。无需认证——用于在没有真实 CRM 的情况下测试整套连接是否正常。 |
登录流程
start_crm_login 无法阻塞等待 Entra 完成,因此被拆成两个部分:
调用
start_crm_login。它会返回设备代码和需要打开的 URL。在浏览器中完成登录。
调用
crm_login_status进行确认。一旦它报告了已登录用户,search_crm_accounts即可正常工作。
令牌仅保存在内存中——重启服务器后需要重新登录。
许可证
ISC
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
- FlicenseNot gradedqualityDmaintenanceBridges stdio-based LLM harnesses to OAuth-protected remote MCP servers via Streamable HTTP, handling PKCE browser login and token refresh automatically.9
- AlicenseNot gradedqualityCmaintenanceExposes a user-authenticated Microsoft 365 Copilot Chat browser session as a stdio MCP server, enabling AI-powered chat interactions via MCP tools like copilot_chat and copilot_status.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables managing Onde Inference accounts and model catalog operations through MCP tools such as login, app management, model registration, and assignment. Returns structured JSON over stdio for use with any MCP client.Apache 2.0
- FlicenseNot gradedqualityBmaintenanceProvides MCP tools to interact with GoHighLevel CRM data, including contacts, conversations, call transcripts, broker lead overviews, pipelines/opportunities, and task creation. Supports both stdio and HTTP transports for local and remote use.
Related MCP Connectors
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
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/Saipranoy/mcp-crm'
If you have feedback or need assistance with the MCP directory API, please join our Discord server