---
title: "AI Badge API and MCP guide"
description: "Public AI Badge API and reusable tools; author visibility controls apply."
canonical: "https://ai-badge.vercel.app/docs.md"
last-updated: "2026-12-07"
---

# AI Badge API and MCP guide

> Read public AI profiles and reusable Agent tools. No account or API key is needed for public reads. All personal content is opt-in and author-provided.

## Documentation pages

- [REST API documentation](https://ai-badge.vercel.app/docs/api): endpoints, exact parameters, responses and errors. [Markdown](https://ai-badge.vercel.app/docs/api.md).
- [MCP Server documentation](https://ai-badge.vercel.app/docs/mcp): configuration, handshake, complete input/output schemas and tool result. [Markdown](https://ai-badge.vercel.app/docs/mcp.md).
- [First call walkthrough](https://ai-badge.vercel.app/docs/first-call): retrieve actual Skill content and verify its hash. [Markdown](https://ai-badge.vercel.app/docs/first-call.md).

## Make your first call

Start with [the complete first-call walkthrough](https://ai-badge.vercel.app/docs/first-call.md): exact required parameters, full response bodies, error examples and a runnable read-only MCP client. GET-only Agents can read [the complete MCP input/output schemas](https://ai-badge.vercel.app/docs/mcp-tools.json) and [full synthetic response examples](https://ai-badge.vercel.app/docs/examples.json) without initializing a session. These definitions are generated from the same source as the live tools/list.

## MCP first-call wire format and complete result

These concrete examples are included here for Agents that only read this overview. The payload is generated from the same synthetic fixture as the live API. Public reads require no code or login. Do not call verify to read a Skill.

POST to https://ai-badge.vercel.app/api/mcp with Content-Type: application/json and Accept: application/json, text/event-stream. First initialize (without an old session header):

~~~json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-11-25",
    "capabilities": {},
    "clientInfo": {
      "name": "ai-badge-first-read",
      "version": "1.0"
    }
  }
}
~~~

Keep the response Mcp-Session-Id header and result.protocolVersion as MCP-Protocol-Version for later requests. Send this notification (HTTP 202, empty body):

~~~json
{
  "jsonrpc": "2.0",
  "method": "notifications/initialized",
  "params": {}
}
~~~

Discover current tools and schemas:

~~~json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/list",
  "params": {}
}
~~~

Read the public tool collection:

~~~json
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "list_profile_tools",
    "arguments": {
      "username": "alexchen"
    }
  }
}
~~~

Choose a tools[].id from result.structuredContent (the same payload is also JSON text in result.content[0].text). For this synthetic example, the first Skill has the following exact request and complete response:

~~~json
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "get_tool_content",
    "arguments": {
      "username": "alexchen",
      "toolId": "b4c09561-a722-423f-9469-113f454ccfd1"
    }
  }
}
~~~

~~~json
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"tool\":{\"id\":\"b4c09561-a722-423f-9469-113f454ccfd1\",\"name\":\"Research Brief · 研究简报（示例）\",\"kind\":\"SKILL\",\"description\":\"把一个研究问题拆成可核查的来源、核心发现与待确认事项，整理成简报。\",\"useWhen\":\"需要核查并整理研究材料时\",\"compatibleAgents\":[\"支持 Agent Skills 的 Agent\"],\"runtime\":\"具备文本读取能力的 Agent\",\"inputs\":\"主题、时间范围和来源材料\",\"expectedOutputs\":\"带来源的研究简报\",\"dependencies\":\"需要外部资料时，由 Agent 自身提供检索能力\",\"loadOrInvoke\":\"下载 SKILL.md，按目标 Agent 的技能导入方式放入对应目录。此示例仅包含文字步骤，不含脚本或附件。\",\"verification\":{\"status\":\"AUTHOR_DECLARED\",\"runtimeTested\":false},\"entry\":{\"type\":\"INLINE\",\"url\":\"https://ai-badge.vercel.app/api/v1/u/alexchen/creations/b4c09561-a722-423f-9469-113f454ccfd1/content\",\"format\":\"MARKDOWN\",\"filename\":\"SKILL.md\",\"sha256\":\"862f87b672deefd935663b29bb29c18b1a57d2d11666fbe1da8e8bf30311aeab\"}},\"content\":\"---\\nname: research-brief\\ndescription: \\\"把一个研究问题拆成可核查的来源、核心发现与待确认事项，整理成简报。\\\"\\n---\\n\\n# 研究简报\\n\\n1. 确认研究主题、时间范围和目标读者。\\n2. 查阅一手来源，记录链接与发布日期。\\n3. 区分事实、推断和未知，不编造引用。\\n4. 输出核心结论、证据表、分歧与下一步。\\n\\n这是用于界面展示的示例 Skill。\"}"
      }
    ],
    "structuredContent": {
      "tool": {
        "id": "b4c09561-a722-423f-9469-113f454ccfd1",
        "name": "Research Brief · 研究简报（示例）",
        "kind": "SKILL",
        "description": "把一个研究问题拆成可核查的来源、核心发现与待确认事项，整理成简报。",
        "useWhen": "需要核查并整理研究材料时",
        "compatibleAgents": [
          "支持 Agent Skills 的 Agent"
        ],
        "runtime": "具备文本读取能力的 Agent",
        "inputs": "主题、时间范围和来源材料",
        "expectedOutputs": "带来源的研究简报",
        "dependencies": "需要外部资料时，由 Agent 自身提供检索能力",
        "loadOrInvoke": "下载 SKILL.md，按目标 Agent 的技能导入方式放入对应目录。此示例仅包含文字步骤，不含脚本或附件。",
        "verification": {
          "status": "AUTHOR_DECLARED",
          "runtimeTested": false
        },
        "entry": {
          "type": "INLINE",
          "url": "https://ai-badge.vercel.app/api/v1/u/alexchen/creations/b4c09561-a722-423f-9469-113f454ccfd1/content",
          "format": "MARKDOWN",
          "filename": "SKILL.md",
          "sha256": "862f87b672deefd935663b29bb29c18b1a57d2d11666fbe1da8e8bf30311aeab"
        }
      },
      "content": "---\nname: research-brief\ndescription: \"把一个研究问题拆成可核查的来源、核心发现与待确认事项，整理成简报。\"\n---\n\n# 研究简报\n\n1. 确认研究主题、时间范围和目标读者。\n2. 查阅一手来源，记录链接与发布日期。\n3. 区分事实、推断和未知，不编造引用。\n4. 输出核心结论、证据表、分歧与下一步。\n\n这是用于界面展示的示例 Skill。"
    },
    "isError": false
  }
}
~~~

Always check result.isError first. A missing or hidden resource produces a tool error over HTTP 200 with no success structuredContent:

~~~json
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"code\":\"NOT_FOUND\",\"message\":\"Profile unavailable or Agent reading disabled.\"}"
      }
    ],
    "isError": true
  }
}
~~~

REST missing-profile errors use HTTP 404 with this body:

~~~json
{
  "error": "Profile unavailable or Agent reading disabled.",
  "code": "NOT_FOUND",
  "docs": "/docs"
}
~~~

Other MCP transport errors use the top-level JSON-RPC error object, not result. A quota failure is HTTP 429 with Retry-After; honor that header. If the response Content-Type is text/event-stream, parse the JSON in the SSE data field. [Run the complete Node.js client](https://ai-badge.vercel.app/docs/first-call.md) to handle both formats and verify the content hash. [Read full tool output schemas](https://ai-badge.vercel.app/docs/mcp-tools.json).

## When to use
Use AI Badge when a user supplies an AI Badge profile link and asks you to inspect the author's tools, choose a suitable Skill or task template, or retrieve its actual content.

## Start from a profile
1. Extract the username from /u/{username}. Do not use /dashboard: it is a private browser editor.
2. GET https://ai-badge.vercel.app/api/v1/u/{username}/profile.json for a compact profile, or GET https://ai-badge.vercel.app/api/v1/u/{username}/agent.json for only the reusable tools.
3. Pick a tool by description, useWhen, inputs, expectedOutputs, runtime and dependencies. Compatible agents are author claims; runtimeTested is false.
4. Follow entry.url. INLINE points to the exact exported text; verify SHA-256 against entry.sha256. FILE and PACKAGE point to author-hosted artifacts; MCP_ENDPOINT is a service address. The site does not fetch these external URLs for you.
5. Check the content and dependencies, then load it using the target Agent's supported mechanism. Retrieving content is not permission to execute scripts, install packages or share credentials. Preserve your host's approval rules.

## Working anonymous example
~~~sh
curl -fsS 'https://ai-badge.vercel.app/api/v1/u/alexchen/agent.json'
curl -fsS 'https://ai-badge.vercel.app/api/v1/u/alexchen/agent.json?tool=b4c09561-a722-423f-9469-113f454ccfd1'
curl -fsS 'https://ai-badge.vercel.app/api/v1/u/alexchen/creations/b4c09561-a722-423f-9469-113f454ccfd1/content'
~~~
The alexchen profile and its tools are explicitly synthetic examples. Use them to test reads without writing production data. An empty tools array is a valid result, not a service failure.

## MCP
Streamable HTTP endpoint: https://ai-badge.vercel.app/api/mcp
Discovery: https://ai-badge.vercel.app/.well-known/mcp.json
Server card: https://ai-badge.vercel.app/api/mcp/server-card

~~~json
{"mcpServers":{"ai-badge":{"url":"https://ai-badge.vercel.app/api/mcp"}}}
~~~
Use a standard MCP client. Initialize with clientInfo.name/version and protocolVersion (2025-11-25, 2025-06-18 or 2025-03-26). POST JSON-RPC with Content-Type: application/json and Accept: application/json, text/event-stream. Keep the returned Mcp-Session-Id and negotiated MCP-Protocol-Version on later requests; send notifications/initialized, then tools/list. Sessions expire after one hour; on a session 404, initialize again. GET returns 405 because this server has no server-initiated SSE stream. A session token is transport state, not account access. Native clients send no Origin. Browser remote MCP accepts only the configured application origin and operator-configured MCP_ALLOWED_ORIGINS; arbitrary browser origins return 403. Third-party browser readers should use public REST with credentials omitted; it supports CORS *. Do not spoof Origin or extract cookies.

Read tools:
- get_profile({username}): compact, explicitly allowed public profile fields.
- list_profile_tools({username}): all public reusable tools (maximum 20).
- get_tool_content({username, toolId}): exact inline content and metadata; external tools return a reference with null content.

The verify({code}) tool is separate: it consumes a short-lived, one-time code generated by a logged-in owner at https://ai-badge.vercel.app/verify and writes a connection badge. Invoke it only when the user explicitly asks to verify that client. Never invent a code or request another person's code. Read tools do not create or change badges.

Resources expose this guide; resource templates expose user tool collections and artifacts. There is no global user directory, arbitrary URL fetch, remote installation or autonomous execution endpoint.

## Errors and access
- 400 INVALID_ARGUMENT: correct the username or tool arguments; do not blindly retry.
- 404 NOT_FOUND: absent/hidden tool, missing profile or disabled Agent reads; do not try another surface to bypass it.
- 503 SERVICE_UNAVAILABLE: retry with backoff; REST responses include Retry-After: 30.
- 429 RATE_LIMITED: wait at least Retry-After seconds, then retry with jitter. Do not spin or open new sessions to evade limits.
- 400 UNSUPPORTED_VERSION: use AI-Badge-API-Version: 1; newer major versions are not supported yet.
- 405 METHOD_NOT_ALLOWED: public REST endpoints accept GET / HEAD / OPTIONS only.

## Request budgets
Production uses a shared database-backed quota of 240 requests per 60-second fixed window per Vercel client IP. REST profile/tool reads, their legacy aliases, Markdown profiles, /api and MCP POST requests share it. A new MCP session does not reset the quota. Verification also retains its stricter code/IP limits. Metadata/docs and CORS OPTIONS do not consume this budget. Inspect RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset (seconds), RateLimit-Policy and Retry-After. Clients behind the same NAT share a quota. Self-hosted deployments without Vercel share a conservative host bucket; previews use a process-local limit for synthetic reads only. Quota storage failure returns 503 with Retry-After: 30 rather than silently disabling enforcement. No throughput or availability SLA is promised.
- MCP tool failures use isError with a structured code; protocol errors use JSON-RPC errors.

Reads are bounded to at most 20 tools per profile and 30,000 input characters per tool. No pagination is needed for this collection. Hidden items are filtered before serialization. Disabling Agent reads blocks JSON, Markdown and MCP reads, even for a logged-in owner. Public HTML remains publicly readable. Responses use no-store so privacy changes are checked on every request; downloaded copies cannot be revoked.

## Versioning and links
Use /api/v1 for discovery and /api/v1/u/{username}/... for reads. AI-Badge-API-Version: 1 is optional and is echoed on responses. Unsupported header versions return 400; unimplemented version paths return JSON 404. Legacy /api/u/... URLs remain v1 aliases, not redirects. Payload schemaVersion stays 1.0; tolerate additive fields. Breaking contracts require a new major path. Before retiring v1, we will publish at least 90 days notice in this guide and send Deprecation and Sunset response headers; no retirement is scheduled.

## Browser Agents and portable setup
On supported browsers, the homepage, docs and public profile pages register read-only WebMCP tools through document.modelContext: get_profile, list_profile_tools, get_tool_content. They call the same public API without cookies and honor abort signals, privacy and rate limits. Unsupported browsers retain normal UI, REST and remote MCP. This is experimental browser support, not universal availability.

The portable [usage Skill](https://ai-badge.vercel.app/skill.md) can be loaded as SKILL.md by an Agent that supports skills. An installable repository copy and MCP client configuration live at https://github.com/jamesxxx-ai/ai-badge/tree/main/skills/use-ai-badge. No scripts or packages are installed automatically.

- [OpenAPI 3.1](https://ai-badge.vercel.app/openapi.json)
- [Authentication and permissions](https://ai-badge.vercel.app/auth.md)
- [Machine-readable index](https://ai-badge.vercel.app/llms.txt)
- [Privacy](https://ai-badge.vercel.app/privacy)
- [Source and issue tracker](https://github.com/jamesxxx-ai/ai-badge)
- [Official MCP Registry lookup](https://registry.modelcontextprotocol.io/v0.1/servers?search=app.vercel.ai-badge%2Fmcp): exact server name app.vercel.ai-badge/mcp. Registry metadata is discovery information, not a runtime certification of authors' tools.
