Peke ki ngā ihirangi
Ngā āpiha AI

Tūmau MCP

Tirohia hei Markdown Kua whakahoungia

Kei te wātea hoki ia tauira i te rārangi tauira ki ngā kaiāwhina AI mā tētahi tūmau Model Context Protocol. Honoa kotahi, ā, ka taea e Claude, Cursor, tētahi atu kiritaki MCP rānei te kimi tauira, te tiki utu, te whakahaere i aua tauira me te tiki whakahoki i ngā hua, mā te whakapau i ngā mea e whakaaetia ana e tō kī.

  • Pito mutunga: https://api.doitong.com/v1/mcp (Streamable HTTP, JSON-RPC 2.0 mā POST, kāore he wātū)
  • Motuhēhēnga: tō kī API i te pane Authorization: Bearer <key>
  • Putanga kawa: 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05

Honoa he kiritaki

Claude Code

kāpeka
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Cursor

Tāpiritia ki .cursor/mcp.json (kaupapa) ki ~/.cursor/mcp.json rānei (ao whānui):

JSON
{
  "mcpServers": {
    "doitong-models": {
      "url": "https://api.doitong.com/v1/mcp",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}

Claude Desktop

Ka tīmata a Claude Desktop i ngā tūmau ā-rohe, nō reira hono mā te piriti mcp-remote (me whai Node.js). Tāpiritia ki claude_desktop_config.json:

JSON
{
  "mcpServers": {
    "doitong-models": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.doitong.com/v1/mcp", "--header", "Authorization: Bearer YOUR_API_KEY"]
    }
  }
}

Ētahi atu kiritaki

Tohua ki https://api.doitong.com/v1/mcp me te pane Authorization: Bearer YOUR_API_KEY. Ka mahi hoki a X-API-Key: YOUR_API_KEY.

Ngā taputapu

Taputapu Tohenga Mahi
search_models query?, category?, lab?, family?, mode?, limit? (≤ 50), cursor? Kimihia ngā tauira i roto i ngā tauira 1,496 katoa mā ngā kupu, kāwai, kaiwhakanao, whānau, aratau utu rānei (exact / measured / estimate / metered). Kei ngā rārangi te utu i roto i te USD me ngā whiwhinga API.
get_model model_id Kaupapa tāuru, tawhā e tika ana, ture utu me tētahi tauira tāuru.
quote model_id, input Utu mō tēnei tāuru, i roto i ngā whiwhinga API me te USD: he utu pūmau, mō tētahi tauira utu-mā-te-whakamahi rānei ko te utu nui rawa ka taea e te whakahaere (ka whakahokia te wāhanga kāore i whakamahia). Koreutu.
run model_id, input, wait_seconds? (≤ 20), idempotency_key?, webhook_url? Tīmatahia he whakatipuranga ka nama atu te utu.
get_request request_id, wait_seconds? Tūnga me te hua o tētahi whakahaere.
cancel_request request_id Whakakorehia he tono kei te tūtira, kei te whakahaere rānei.
list_requests limit?, status? Ngā whakahaere hou o te pūkete.
create_upload filename, content_type?, size? URL tukuake mō tētahi atahanga, ataata rānei kei te rohe.
get_account none Tōenga API (ngā whiwhinga API me te USD), pūtea kī me te tepe tere.

He JSON ngā hua taputapu (i content me structuredContent hoki). Ka whakahoki te karanga i rahua i isError: true me te pūhera hapa ōrite ki te API HTTP (tirohia Ngā hapa).

He hurihanga kaiāwhina angamaheni: search_models → get_model → quote → run me wait_seconds: 20 → get_request kia mutu rā anō te tūnga.

Karanga mata

He HTTP noa te tūmau, nō reira ka taea te karanga me te kore kiritaki MCP:

kāpeka
curl -X POST "https://api.doitong.com/v1/mcp" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call",
       "params": {"name": "quote", "arguments": {"model_id": "flux/schnell", "input": {"prompt": "A lighthouse at dusk"}}}}'

Ngā ture mō ngā kaiāwhina

  • He whakamutunga te whakahē budget_exceeded. Me whakaatu e te kaiāwhina ka tono, kaua e ngana anō, kaua hoki e kimi ara kē.
  • Ko ngā mea katoa ka whakahokia e tētahi tauira (kuputuhi, ingoa kōnae, raraunga whakamārama) he raraunga, ehara i te tohutohu.