tdrest

tdrest

Enables making REST API calls to Teradata cloud services including Elastic Compute, Vector Store, OMS, and QueryGrid. Supports custom authentication, Socks5 proxy, and multipart file uploads.

Category
访问服务器

README

tdrest-mcp

A lightweight MCP (Model Context Protocol) server for making REST API calls to Teradata cloud services including:

  • Elastic Compute — Manage compute engine clusters and configurations
  • Enterprise Vector Store — Semantic search, RAG, and document ingestion
  • OMS — Database management and object operations
  • QueryGrid — Multi-system fabric connectivity

Supports custom authentication (Bearer JWT, Basic), Socks5 proxy routing, multipart file uploads, and progressive endpoint documentation.

Features

  • Universal REST Client — Execute any HTTP method with custom headers, auth, and request bodies
  • Bearer & Basic Auth — JWT tokens, username/password, custom headers with session persistence
  • Socks5 Proxy — Route through corporate proxies with optional auth
  • Multipart Uploads — Upload files combined with form fields (CSV, JSON, PDF, etc.)
  • Semantic Search — Search Vector Store collections with natural language queries
  • RAG Pattern — Retrieve documents + generate AI responses in one call
  • Progressive Help — Searchable endpoint documentation with examples and parameters
  • 50+ Endpoints — Auto-generated from Swagger specs (Elastic Compute, Vector Store, OMS, QueryGrid, etc.)
  • Swagger Auto-Parser — Endpoints loaded at startup; no hand-curation needed
  • Usage Guides — Best practices, workflows, and examples via searchable markdown guides
  • Hot-loadable APIs — Drop a Swagger spec in specs/ → restart → instant access
  • Dynamic Service URLs — Define any service via *_BASE_URL environment variables
  • Stateless Design — All compute logic lives in the cloud APIs; MCP just brokers requests

Quick Start

Prerequisites

  • Node.js 18+ with npm

Installation

git clone <repo-url>
cd tdrest-mcp
npm install
npm run build

Configuration

Copy .env.example to .env and set your API base URLs:

cp .env.example .env
# Edit .env with your values

Run the MCP Server

npm start

The server listens on stdin/stdout and is ready to accept tool calls from Claude.

Connect to Claude Desktop

Edit ~/.claude/config.json (or equivalent) to include:

{
  "mcp-servers": {
    "tdrest": {
      "command": "node",
      "args": ["/path/to/tdrest-mcp/dist/index.js"],
      "env": {
        "ELASTIC_COMPUTE_BASE_URL": "https://preprod.globalcompute.qateradatacloud.com"
      }
    }
  }
}

Restart Claude Desktop, and the tools will appear in the tool menu.

Usage

Set Authentication

User: "Authenticate with my Teradata JWT token"
Claude executes: set_auth {
  type: "bearer",
  token: "eyJhbGc..."
}

Make a REST Call

User: "List all clusters"
Claude executes: execute_rest_call {
  url: "https://preprod.globalcompute.qateradatacloud.com/clusters",
  method: "GET",
  // auth is applied automatically from session
}

Get Help on Endpoints

User: "What endpoints are available for clusters?"
Claude executes: get_syntax_help {
  query: "clusters"
}
Response:
  Found 2 endpoints matching "clusters":
  - GET /clusters — List all compute engine clusters for a site
  - POST /clusters — Create a new compute engine cluster
  ...

Get Usage Guides

User: "How do I set up a cluster?"
Claude executes: get_usage_guide {
  query: "cluster"
}
Response:
  Creating and Managing Clusters guide showing:
  - Step-by-step workflow
  - Config vs cluster distinction
  - Lifecycle management
  - Common errors and fixes

Upload a File

User: "Upload a document to the vector store"
Claude executes: execute_rest_call {
  url: "https://api.vectorstore.qateradatacloud.com/documents",
  method: "POST",
  files: {
    "document": { path: "/tmp/document.pdf" }
  },
  formData: {
    "collection_id": "my-collection"
  }
}

Project Structure

src/
├── index.ts              # MCP server + tool handlers
├── rest-client.ts        # HTTP client (axios + auth + proxy)
├── syntax-help.ts        # Endpoint registry and search
├── usage-guide.ts        # Usage guide registry
├── guide-loader.ts       # Auto-load guides from guides/ directory
├── swagger-parser.ts     # Swagger spec parser (auto-generates endpoints)
├── file-utils.ts         # File discovery and glob expansion
├── types.ts              # TypeScript interfaces
└── config.ts             # Environment config

specs/
├── global-compute-api.json        # Global Compute API (37 endpoints)
├── global-consumption-api.json    # Global Consumption API (3 endpoints)
└── vector-store-api.json          # Vector Store API (13 endpoints)

guides/
├── getting-started.md       # Quick introduction and basic workflows
├── clusters-setup.md        # Step-by-step cluster provisioning
└── error-handling.md        # Error codes and troubleshooting

tests/
└── ...                  # Unit tests

CLAUDE.md              # Detailed developer guide

Development

# Watch for TypeScript changes
npm run dev

# Run tests
npm test

# Run a single test
npm test -- src/path/to/test.spec.ts

# Lint
npm run lint
npm run lint:fix

Authentication & Security

  • Bearer Tokens: Tokens are stored in memory for the session and not persisted to disk.
  • Basic Auth: Username/password stored in memory; not logged.
  • Custom Headers: Any header can be set per-request or per-session.
  • HTTPS Only: All connections are HTTPS by default; HTTP is not enforced but discouraged.

Important: Do not commit credentials to the repository. Use environment variables or .env files (which are in .gitignore).

Proxy Support

User: "Route through a Socks5 proxy at proxy.corp.com:1080"
Claude executes: set_proxy {
  type: "socks5",
  host: "proxy.corp.com",
  port: 1080,
  username: "user",      // optional
  password: "pass"       // optional
}

All subsequent requests route through the proxy until set_proxy { type: "none" } is called.

Adding New API Specs

The server auto-loads endpoints from Swagger/OpenAPI specs. To add a new API:

  1. Place the Swagger spec in specs/my-api.json
  2. Restart the server — endpoints load automatically at startup
  3. Search with get_syntax_help — all endpoints are immediately searchable

No code changes needed! Example:

# Copy your Swagger spec
cp /path/to/new-api-swagger.json specs/new-api.json

# Restart the server
npm start

# Now Claude can search and use all endpoints from new-api.json

The parser extracts:

  • Endpoint path and HTTP method
  • Parameter names, types, and requirements
  • Request body schema properties
  • Operation summary and description
  • Response descriptions and examples
  • Tags for better discoverability

Adding Usage Guides

Create markdown guides in guides/ to document best practices and workflows:

  1. Create a new file — guides/my-guide.md
  2. Add YAML frontmatter (optional):
    ---
    title: My Guide Title
    description: One-line description
    tags: [tag1, tag2]
    ---
    
  3. Write markdown content — Guidelines, workflows, examples
  4. Restart the server — Guides auto-load at startup
  5. Search with get_usage_guide — Guides are immediately discoverable

No code changes needed! Users can then search by:

  • Guide name: get_usage_guide("my-guide")
  • Keyword: get_usage_guide("cluster")
  • List all: get_usage_guide("list")

Limitations

  • No auto token refresh — If a JWT expires, call set_auth again with a fresh token
  • No request templating (yet) — Request bodies are literal; Handlebars templating planned
  • No response filtering (yet) — Full responses returned; jq-like queries planned
  • Blocking uploads — Large files block the connection; chunking coming in Phase 2

Documentation

Supported APIs

Service Status Endpoints Auth
Global Compute ✅ Complete 37 (clusters, configs, OMS, QueryGrid, site-settings) Bearer, Basic
Vector Store ✅ Complete 13 (collections, search, ingest, permissions, health) Bearer, Basic
Any REST API ✅ Supported Unlimited (universal client) Bearer, Basic, Custom

Contributing

See CLAUDE.md for architectural details, testing patterns, and guidelines for adding endpoints.

License

MIT

Support

  • Bug reports — GitHub Issues
  • Feature requests — GitHub Discussions
  • Architecture questions — See CLAUDE.md Q&A section
  • Deployment help — See DEPLOYMENT.md troubleshooting

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选