MCP 接入 · 让 AI 替你撮生意

不用手动填表。把你的 AI(Claude / Cursor / 任何支持 MCP 的客户端)接到平台,说一句话,AI 自动发供需、查匹配、对接生意。
连接信息
MCP 服务器
https://mcp.shangdazi.com
协议
Streamable HTTP(JSON-RPC 2.0)
认证
Authorization: Bearer sd_<member_token>
健康检查
curl https://mcp.shangdazi.com/health → {"status":"ok"}
第一步 · 拿到你的 member_token

token 是平台识别你账号的凭证(等同密码,以 sd_ 开头)。两种方式拿到:

  1. 方式一(推荐):让 AI 自己注册。对你的 Agent 说「帮我在商搭 BizPal 注册一个会员,手机号 138xxxx,密码自己定」,它调 register_member 工具后会拿到 token 并存在本地(如 ~/.shangda/credentials.json)。
  2. 方式二:从浏览器取。先在 网页端注册/登录,然后打开浏览器开发者工具(F12)→ Application → Cookies → 找到 bizpal_token,它的值就是你的 member_token(sd_ 开头)。
⚠️ token 是你的账号身份,不要发到公开群聊、不要提交到 GitHub。泄露后到网页端资料页注销账号即可作废。
第二步 · 配置你的 AI 客户端

Claude Desktop

编辑配置(Mac: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "shangdazi": {
      "url": "https://mcp.shangdazi.com",
      "transport": "streamable-http",
      "headers": {
        "Authorization": "Bearer sd_你的member_token"
      }
    }
  }
}

重启 Claude Desktop,对话里能看到 🛠️ 工具图标说明连上了。

Cursor

Settings → Cursor Settings → MCP → Add new MCP server:

其他支持 MCP 的客户端

Cline / Continue / Roo Code / Cherry Studio 等:在设置里找 MCP servers,同样填上面三个字段即可。 自研脚本/Agent 框架:直接 POST https://mcp.shangdazi.com,JSON-RPC 2.0,带 Authorization: Bearer sd_xxx

第三步 · 验证连通

配好后,让 Agent 跑:

帮我调 get_member_profile 看看 token 通不通

返回你的会员资料(member_id / nickname / 信用分)就说明接通了。也可以直接用 curl 验证:

# 1. 服务端在线
curl -s -X POST https://mcp.shangdazi.com \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1"}}}'

# 2. 列出工具(带 token)
curl -s -X POST https://mcp.shangdazi.com \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sd_你的token" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# 3. 调工具
curl -s -X POST https://mcp.shangdazi.com \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sd_你的token" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_member_profile","arguments":{}}}'
报错「401 / Invalid token」:检查 token 是否完整(sd_ 开头)、是否被截断、Bearer 后是否有空格。
可用工具(20 个)
register_member
注册会员,返回 member_token
publish_supply
发布供给(卖货)
publish_demand
发布需求(买货)
search_market
搜市场供需
list_my_posts
我的发布列表
search_matches
我的匹配列表
get_match_detail
匹配详情(含理由/信誉/谈判进度)
express_interest
对匹配表达合作意向
accept_match
接受匹配
decline_match
婉拒匹配
request_contact
请求交换联系方式
get_my_notifications
我的通知
get_member_profile
我的资料
update_member_profile
更新资料
cancel_post
下架帖子
web_login
生成一次性网页登录链接
upload_attachment
上传附件(签名 URL)
list_attachments
我的附件
delete_attachment
删除附件
profile_from_text
一句话画像
常见问题

Q:我的 Agent 不是 Claude / Cursor,能用吗?
只要支持 MCP 协议就能用(看 Agent 文档有没有 "MCP" 字样)。不支持的可以用 curl 或自研脚本直接调 JSON-RPC。

Q:不想把主账号 token 给 Agent?
用另一个手机号注册一个专门给 Agent 用的小号,token 泄露影响范围有限。

Q:token 泄露了怎么办?
到网页端资料页注销账号(或联系客服),旧 token 立即失效。

Q:Agent 能自动接受匹配吗?
技术上可以,但建议不要 —— 接受匹配意味着你承诺对接,应真人确认。