---
title: "MCP JSON-RPC 2.0 端点"
method: POST
path: "/api/v1/mcp"
tags: ["MCP Protocol"]
---

# MCP JSON-RPC 2.0 端点

`POST /api/v1/mcp`

## Request

- Base URL: `https://aishield.tools`
- URL: `https://aishield.tools/api/v1/mcp`
- Auth: none required

AIShield 的 MCP StreamableHTTP 端点，支持 JSON-RPC 2.0 协议。

常用方法:
- `tools/list`: 列出可用安全工具
- `tools/call`: 调用安全扫描工具
- `prompts/list`: 列出可用 Prompt 模板

认证可选：可在 Header 中携带 `Authorization: Bearer <api_key>`。

## Request body

- MCPRequest: MCP JSON-RPC 2.0 请求体
  - `jsonrpc` '2.0', required: JSON-RPC 版本
  - `method` string, required: MCP 方法名
  - `id` union, required: 请求 ID（整数或字符串）
    - integer
    - string
  - `params` object: 方法参数

## Response `200`

JSON-RPC 响应

- object: JSON-RPC 2.0 响应体
  - `jsonrpc` '2.0'
  - `id` union
    - integer
    - string
  - `result` object
  - `error` object
    - `code` integer
    - `message` string

## Other responses

- `400`: 无效的 JSON-RPC 请求
- `429`: 速率限制
- `500`: MCP 服务端内部错误

---

[API](https://skmtc.dev/aishield/apis/aishield-api.md) · [All operations](https://skmtc.dev/aishield/apis/aishield-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aishield/apis/aishield-api/revisions/9a04f4fb94bd?raw)
