Content
# TdxClaw-compatible MCP Server
An independent local MCP Server that replicates the data request capabilities of TdxClaw (openclaw). Allows your agent to call web scraping, search, and HTTP request tools through the MCP protocol without installing TdxClaw.
## Tool List
| Tool | Description |
|------|-------------|
| `web_fetch` | Fetches web content, automatically converts to Markdown or plain text, with SSRF protection |
| `web_search` | Searches the web using DuckDuckGo, no API Key required |
| `http_request` | Universal HTTP request tool, supports GET/POST/PUT/PATCH/DELETE, custom headers and body |
## Quick Start
### Prerequisites
- [uv](https://docs.astral.sh/uv/) (TdxClaw bundled: `C:\TdxClaw\resources\bin\uv.exe`)
- or Python 3.10+
### Method 1: Using the startup script (recommended)
```cmd
start.cmd
```
The first run will automatically create a virtual environment and install dependencies.
### Method 2: Manual run
```bash
cd tdx-mcp-server
# Create a virtual environment and install dependencies
uv venv
uv pip install "mcp[cli]>=1.0.0" "httpx>=0.27.0" "beautifulsoup4>=4.12.0" "markdownify>=0.13.0" "duckduckgo-search>=6.0.0"
# Start stdio mode (most MCP clients)
.venv\Scripts\python.exe server.py
# or start HTTP mode (openclaw-style agent)
.venv\Scripts\python.exe server.py --http --port 31868
```
## Connect Your Agent
### Stdio Mode (for most MCP clients)
Add to your agent's MCP configuration:
```json
{
"mcpServers": {
"tdx-mcp": {
"command": "C:\\path\\to\\tdx-mcp-server\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\tdx-mcp-server\\server.py"]
}
}
}
```
### HTTP Mode (for openclaw and other HTTP MCP-enabled agents)
Start the HTTP server:
```bash
.venv\Scripts\python.exe server.py --http --port 31868
```
Then point your agent configuration to `http://127.0.0.1:31868/mcp`.
### OpenClaw Configuration Example
Add to `openclaw.json`:
```json
{
"mcp": {
"servers": {
"tdx-mcp": {
"type": "http",
"url": "http://127.0.0.1:31868/mcp"
}
}
}
}
```
or use stdio:
```json
{
"mcp": {
"servers": {
"tdx-mcp": {
"command": "C:\\path\\to\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\server.py"]
}
}
}
}
```
## Tool Parameter Description
### web_fetch
```json
{
"url": "https://example.com",
"extractMode": "markdown",
"maxChars": 20000
}
```
### web_search
```json
{
"query": "search query",
"maxResults": 5,
"region": "cn-zh"
}
```
### http_request
```json
{
"url": "https://api.example.com/data",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
"body": "{\"key\": \"value\"}",
"timeout": 30,
"maxChars": 20000
}
```
## Comparison with TdxClaw MCP
| Feature | TdxClaw MCP | This Server |
|------|-------------|-------------|
| Transport Protocol | HTTP (Streamable HTTP) | Stdio + HTTP |
| Default Port | 31868 | 31868 (HTTP mode) |
| web_fetch | ✅ | ✅ |
| web_search | ✅ (API Key required) | ✅ (DuckDuckGo, free) |
| http_request | ❌ | ✅ |
| Authentication | Bearer Token | None (local use) |
| SSRF Protection | ✅ | ✅ |
| Dependencies | Full TdxClaw installation | Only Python + a few packages |