最后更新时间:2026-09-22 18:42:35
list_columns列出所有栏目,无参数。
{
"name": "list_columns",
"arguments": {}
}get_column{
"name": "get_column",
"arguments": {
"id": 1
}
}create_column创建栏目。当前 MCP 输入 Schema 会要求栏目字段完整传入,建议使用以下完整结构:
{
"name": "create_column",
"arguments": {
"pid": 0,
"name": "MCP 栏目",
"title": "MCP 栏目标题",
"description": "",
"keywords": "",
"slug": "mcp-column",
"kind": 1,
"status": 1,
"link_url": "",
"link_target": "_self",
"img": "",
"template": "",
"c_template": "",
"limit_num": 10,
"sort": 0,
"inherit": 0,
"ext": "",
"content": ""
}
}成功返回新建栏目的 ID:
{
"id": 42
}update_column{
"name": "update_column",
"arguments": {
"id": 1,
"pid": 0,
"name": "更新后的栏目",
"title": "更新后的标题",
"description": "更新后的描述",
"keywords": "",
"slug": "mcp-column",
"kind": 1,
"status": 1,
"link_url": "",
"link_target": "_self",
"img": "",
"template": "",
"c_template": "",
"limit_num": 10,
"sort": 0,
"inherit": 0,
"ext": "",
"content": ""
}
}delete_column只能删除空栏目:
{
"name": "delete_column",
"arguments": {
"id": 1
}
}小结:create_column 必填 name 和 slug,update_column 与 delete_column 必填 id;三者成功时均返回 {"ok": true}。
list_articles列出文章,工具内部会省略长正文内容。
所有筛选字段都是可选的,只传需要的即可;current 默认 1,size 默认 20、上限 100。返回结构为 {"total": 总数, "current": 页码, "size": 每页条数, "items": [...]},其中分页值已按服务端默认值归一化。
只做分页时:
{
"name": "list_articles",
"arguments": {
"current": 1,
"size": 10
}
}按栏目和标题筛选时:
{
"name": "list_articles",
"arguments": {
"column_id": 1,
"title": "产品",
"status": 1,
"current": 1,
"size": 20
}
}可选字段:id、id_gt、id_lt、slug、title、tags、column_id、column_ids、status、uid、current、size、order、before_sort、before_id。status 为 0 表示不过滤状态。
get_article返回完整文章对象,包括 content 和 ext:
{
"name": "get_article",
"arguments": {
"id": 1
}
}为安全起见,password 字段在 MCP 返回中被置空。
create_article必填字段只有 title 和 column_id,其余字段可选,未传的字段使用服务端默认值:
{
"name": "create_article",
"arguments": {
"title": "MCP 文章标题",
"column_id": 1,
"content": "MCP 文章正文
",
"status": 1,
"slug": "mcp-article",
"description": "文章摘要",
"keywords": "mcp"
}
}成功返回新建内容的 ID:
{
"id": 12
}column_id 必须是已存在的栏目 ID(外部 HTTP API 用的是 column_name,两者不同)。
update_articleid 必填,只传需要修改的字段即可,未提供的字段保持原值:
{
"name": "update_article",
"arguments": {
"id": 1,
"title": "更新后的标题",
"content": "更新后的正文
"
}
}成功返回:
{
"ok": true
}字段语义分两类:
content、description、keywords、origin、albums、author、password、img、tags:不传表示保持原值;显式传空字符串才是清空。name、title、slug、column_id、status、source、price、enable_reply、sort、create_time、ext、tag_ids):不传或传零值表示不修改。因此下面的调用只会改标题,不会动正文:
{
"name": "update_article",
"arguments": {
"id": 1,
"title": "只改标题"
}
}delete_article{
"name": "delete_article",
"arguments": {
"id": 1
}
}成功返回:
{
"ok": true
}调用 get_column:
curl -X POST "http://127.0.0.1:8000/api/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"jsonrpc": "2.0",
"id": 10,
"method": "tools/call",
"params": {
"name": "get_column",
"arguments": {
"id": 1
}
}
}'调用 get_article:
curl -X POST "http://127.0.0.1:8000/api/mcp" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"jsonrpc": "2.0",
"id": 11,
"method": "tools/call",
"params": {
"name": "get_article",
"arguments": {
"id": 1
}
}
}'