Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# AGENTS.md — uapi-mcp

This file tells AI coding agents (Codex, Claude Code, Cursor, OpenCode, Gemini,
etc.) what this repository is and how to wire up the **UAPI MCP server**.

## What this repo is

The official MCP (Model Context Protocol) server for the public API platform
[uapis.cn](https://uapis.cn). It exposes **100+ UAPI endpoints** — network
lookups, text utilities, image processing, social-platform queries,
translation, search, weather, time, OCR — as MCP tools that any MCP-aware
AI agent can call directly.

## Hosted server (recommended)

A managed Streamable-HTTP MCP server is already running. Most agents only
need this one URL:

```
https://uapis.cn/mcp
```

Discovery shortcuts:

- Server card: <https://uapis.cn/.well-known/mcp/server-card.json>
- WebMCP descriptor: <https://uapis.cn/.well-known/webmcp>
- Agent card: <https://uapis.cn/.well-known/agent-card.json>

Wiring it into common agents:

```jsonc
// Claude Desktop / Claude Code (claude_desktop_config.json)
{
"mcpServers": {
"uapi": {
"transport": "streamable-http",
"url": "https://uapis.cn/mcp"
}
}
}
```

```jsonc
// Cursor (.cursor/mcp.json)
{
"mcpServers": {
"uapi": {
"url": "https://uapis.cn/mcp"
}
}
}
```

For paid endpoints, set the UAPI key once via the `X-API-Key` header
(MCP servers may forward `mcpAuth.bearer` to this header — see the
server card for details).

## Local install (npm)

The same server is published on npm and runs over stdio for local agents:

```bash
# Run directly (no install)
npx -y uapi-mcp start --mode dynamic

# Or install globally
npm i -g uapi-mcp
uapi-mcp start --mode dynamic
```

Stdio config example:

```jsonc
{
"mcpServers": {
"uapi": {
"command": "npx",
"args": ["-y", "uapi-mcp", "start", "--mode", "dynamic"]
}
}
}
```

## Build from source

```bash
git clone https://github.com/AxT-Team/uapi-mcp
cd uapi-mcp
npm install
npm run build
node ./bin/mcp-server.js start --mode dynamic
```

## Available tools

The server exposes one MCP tool per UAPI operation. Operation IDs and
schemas come straight from the OpenAPI document at
<https://uapis.cn/openapi.json>, so the tool list mirrors the REST API
1-to-1. Examples:

- `get_misc_weather` — current weather + forecast for a city
- `get_network_whois` — WHOIS lookup
- `get_text_md5` / `post_text_md5_verify` — MD5 hashing & verification
- `post_image_compress` — image compression
- `post_translate_text` — text translation

Run `npx uapi-mcp tools list` (or the equivalent MCP `tools/list` call)
to see the full list at runtime.

## Authentication

- Free-tier endpoints work with no auth.
- Paid endpoints need an `X-API-Key`. Get one at
<https://uapis.cn/console>.
- For OAuth-style flows, see
<https://uapis.cn/.well-known/oauth-authorization-server>.

## Rate limits

UAPI returns standard rate-limit headers
(`X-RateLimit-Limit`, `X-RateLimit-Remaining`, `Retry-After`). The MCP
server forwards them on tool errors so the agent can back off properly.

## Related repos

- Skills bundle: <https://github.com/AxT-Team/uapi-agent-skills>
- Browser SDK: <https://github.com/AxT-Team/uapi-browser-sdk>
- TypeScript SDK: <https://github.com/AxT-Team/uapi-sdk-typescript>
- Python SDK: <https://github.com/AxT-Team/uapi-sdk-python>
- CLI: <https://github.com/AxT-Team/uapi-cli>
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Dockerfile for uapi-mcp.
# Used by the Smithery deployment manifest (smithery.yaml).
FROM node:20-bullseye-slim

WORKDIR /app

ENV NODE_ENV=production
ENV CI=1

# Install just the npm package (and its deps). The package's prepublishOnly
# script bundles the server into ./bin/mcp-server.js, so a fresh `npm install`
# of the published version pulls down a runnable build.
RUN npm install -g uapi-mcp@latest

# Smithery runs MCP servers over stdio.
ENTRYPOINT ["uapi-mcp", "start", "--mode", "dynamic"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 AxT-Team / UAPI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,60 @@

![Banner](https://raw.githubusercontent.com/AxT-Team/uapi-mcp/main/banner.png?v=20260309-4)

[![npm version](https://img.shields.io/npm/v/uapi-mcp?style=flat-square)](https://www.npmjs.com/package/uapi-mcp)
[![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org/)
[![Docs](https://img.shields.io/badge/Docs-uapis.cn-2EAE5D?style=flat-square)](https://uapis.cn/docs)
[![MCP](https://img.shields.io/badge/MCP-Uapi%20Mcp-7C3AED?style=flat-square)](https://modelcontextprotocol.io/)
[![MCP](https://img.shields.io/badge/MCP-2025--06--18-7C3AED?style=flat-square)](https://modelcontextprotocol.io/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE)

Uapi Mcp 是 `uapis.cn` 的官方 MCP Server,用来把 UAPI 的搜索、翻译、图像、文本处理和网页解析能力整理成统一入口,方便接入支持 MCP 的客户端。
> Official MCP (Model Context Protocol) server for the
> [uapis.cn](https://uapis.cn) public API platform. Exposes **100+ UAPI
> endpoints** — network lookups, text utilities, image processing,
> social-platform queries, translation, search — as agent tools over
> Streamable HTTP and stdio.

## English summary

**Hosted server** (managed, recommended for most agents):

```text
https://uapis.cn/mcp
```

| Wiring | Snippet |
| -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Desktop / Claude Code | `{"mcpServers":{"uapi":{"transport":"streamable-http","url":"https://uapis.cn/mcp"}}}` |
| Cursor (`.cursor/mcp.json`) | `{"mcpServers":{"uapi":{"url":"https://uapis.cn/mcp"}}}` |
| Stdio (npx) | `npx -y uapi-mcp start --mode dynamic` |

**Local install** (stdio, fully offline):

```bash
npx -y uapi-mcp start --mode dynamic
# or
npm install -g uapi-mcp && uapi-mcp start --mode dynamic
```

Authentication:

- Free-tier endpoints work with no key.
- Paid endpoints need `X-API-Key`. Get a key at
[uapis.cn/console](https://uapis.cn/console).

Discovery surfaces:

- Server card: <https://uapis.cn/.well-known/mcp/server-card.json>
- WebMCP descriptor: <https://uapis.cn/.well-known/webmcp>
- OpenAPI spec: <https://uapis.cn/openapi.json>
- LLM context bundle: <https://uapis.cn/llms.txt>

See [`AGENTS.md`](./AGENTS.md) for the full agent-facing playbook.

---

## 中文说明

Uapi Mcp 是 `uapis.cn` 的官方 MCP Server,把 UAPI 的搜索、翻译、图像、文本处理、网页解析能力整合成一个标准化接口,支持任何 MCP 协议客户端。

## 快速开始

Expand Down
25 changes: 20 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@
"author": {
"name": "UAPI"
},
"description": "Uapi Mcp 是 uapis.cn 的官方MCP。它把 UAPI 的搜索、翻译、图像、文本处理和网页解析能力整理成统一的 MCP Server,让你的ai拥有无限的能力~",
"description": "Official MCP server for uapis.cn — exposes 100+ public-API endpoints (network, text, image, social, translation, search) as agent tools.",
"display_name": "Uapi Mcp",
"icon": "banner.png",
"keywords": [
"uapi",
"mcp"
"uapis",
"uapis.cn",
"mcp",
"model-context-protocol",
"agent",
"llm",
"public-api",
"free-api",
"rest-api",
"openapi",
"streamable-http",
"stdio"
],
"long_description": "Uapi Mcp 是 uapis.cn 的官方MCP。它把 UAPI 的搜索、翻译、图像、文本处理和网页解析能力整理成统一的 MCP Server,让你的ai拥有无限的能力~",
"long_description": "uapi-mcp is the official MCP (Model Context Protocol) server for the uapis.cn public API platform. It exposes 100+ free and paid REST endpoints — network lookups, text & image utilities, social platform queries, translation, and search — as MCP tools, so any MCP-aware AI agent (Claude, Cursor, OpenCode, Codex, etc.) can call them directly. Streamable-HTTP transport is hosted at https://uapis.cn/mcp; the same server runs locally over stdio via npx.",
"manifest_version": "0.3",
"name": "uapi-mcp",
"prompts": [],
Expand Down Expand Up @@ -418,5 +429,9 @@
"name": "-post-sensitive-word-quick-check",
"description": "敏感词检测(快速)\n\n在你的社区或应用中,需要过滤不适合展示的内容时,这个接口可以帮你快速完成检测。\n\n## 功能概述\n\n这个接口可以识别文本中的敏感词,并返回是否命中、命中词列表等结果,适合用于评论区、社区、论坛和内容发布场景。\n\n### 主要特性\n\n- **快速检测**:能够一次处理整段文本中的多个命中内容\n- **简繁体支持**:支持简体中文、繁体中文和混合文本检测\n- **结果直观**:返回清晰的检测结果,方便直接接入审核流程\n- **响应稳定**:适合日常内容审核和批量检查场景\n\n无论是论坛、社交平台还是评论系统,这个接口都能帮你快速构建内容审核功能。"
}
]
}
],
"homepage": "https://uapis.cn/mcp",
"repository": "https://github.com/AxT-Team/uapi-mcp",
"documentation": "https://uapis.cn/docs",
"license": "MIT"
}
28 changes: 25 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "uapi-mcp",
"version": "0.1.2",
"author": "UAPI",
"description": "Uapi Mcp 是 uapis.cn 的官方 MCP Server。",
"description": "Official MCP (Model Context Protocol) server for UAPI / uapis.cn — exposes 100+ public-API endpoints (network, text, image, social, translation, search) as agent tools over Streamable HTTP and stdio. uapis.cn 官方 MCP 服务器。",
"type": "module",
"sideEffects": false,
"engines": {
Expand All @@ -12,7 +12,7 @@
"type": "git",
"url": "git+https://github.com/AxT-Team/uapi-mcp.git"
},
"homepage": "https://github.com/AxT-Team/uapi-mcp#readme",
"homepage": "https://uapis.cn/mcp",
"bugs": {
"url": "https://github.com/AxT-Team/uapi-mcp/issues"
},
Expand Down Expand Up @@ -58,5 +58,27 @@
"globals": "^16.0.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.31.1"
}
},
"keywords": [
"uapi",
"uapis",
"uapis.cn",
"mcp",
"model-context-protocol",
"modelcontextprotocol",
"mcp-server",
"agent",
"agents",
"llm",
"ai",
"claude",
"tools",
"public-api",
"free-api",
"rest-api",
"openapi",
"streamable-http",
"stdio"
],
"license": "MIT"
}
33 changes: 33 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Smithery (smithery.ai) deployment manifest for uapi-mcp.
# Reference: https://smithery.ai/docs

startCommand:
type: stdio
configSchema:
type: object
properties:
uapikey:
type: string
title: UAPI API Key
description: |
Your UAPI key from https://uapis.cn/console. Free-tier endpoints
work without a key, paid endpoints require one. The server forwards
this value as an X-API-Key header on every UAPI request.
required: []
commandFunction: |-
(config) => ({
command: "npx",
args: ["-y", "uapi-mcp", "start", "--mode", "dynamic"],
env: {
UAPI_MCP_UAPIKEY: config.uapikey || ""
}
})

build:
dockerfile: Dockerfile

runtime:
protocolVersion: "2025-06-18"
capabilities:
tools:
listChanged: false
Loading