Sentiment402 MCP Adapter

Sentiment402 MCP Adapter

Provides access to Sentiment402 market sentiment data for global markets, crypto, TradFi, and specific assets, with built-in support for x402 micropayment protocol when API responses require payment.

Category
访问服务器

README

Sentiment402 MCP Adapter (stdio)

A thin MCP server that exposes Sentiment402 snapshot endpoints as MCP tools. It calls the public Sentiment402 API over HTTPS and relays x402 payment requirements when the API responds with 402 Payment Required.

This adapter is intentionally stateless and contains no database credentials or admin headers. It is safe to run locally or package as a public MCP tool.

Tool surface

Tool HTTP endpoint Description
get_global_snapshot GET /v1/snapshot/global Global market sentiment snapshot
get_crypto_pulse GET /v1/snapshot/crypto Crypto market sentiment pulse
get_tradfi_pulse GET /v1/snapshot/tradfi TradFi market sentiment pulse
get_asset_view GET /v1/snapshot/asset/:symbol Latest pulse for a specific asset

Common inputs

All tools accept the same optional query inputs (and get_asset_view additionally requires a symbol).

  • format: full or compact_trading
  • fields: comma-separated allowlist (only meaningful when format=compact_trading)
  • symbol: required for get_asset_view

Example tool arguments:

{
  "format": "compact_trading",
  "fields": "headline,trend,confidence"
}

x402 payment handling

When the Sentiment402 API responds with 402, the adapter returns a structured PAYMENT_REQUIRED payload. If SENTIMENT402_X402_PRIVATE_KEY is configured, it will attempt an x402 payment automatically using the options returned by the API. If the payment cannot be completed, the PAYMENT_REQUIRED payload is returned.

Example payload (truncated):

{
  "error": "PAYMENT_REQUIRED",
  "x402Version": 1,
  "resource": "https://sentiment-api.kytona.com/v1/snapshot/global",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "asset": "USDC",
      "amount": "100000",
      "payTo": "0x..."
    }
  ],
  "rawHeader": "..."
}

Caching

A small in-memory cache is used to reduce repeated requests.

  • Default TTL: 60000 ms
  • Cache key: {tool}:{path}?{query}
  • Only 2xx JSON responses are cached
  • 402 responses are never cached

Configuration

Defaults:

  • API base URL: https://sentiment-api.kytona.com
  • API version: v1

Environment variables:

  • SENTIMENT402_API_BASE_URL (optional) — default https://sentiment-api.kytona.com
  • SENTIMENT402_API_VERSION (optional) — v1 (default v1)
  • SENTIMENT402_CACHE_TTL_MS (optional) — cache TTL in ms (default 60000)
  • SENTIMENT402_USER_AGENT (optional) — default sentiment402-mcp/0.1.0
  • SENTIMENT402_X402_PRIVATE_KEY (optional) — EVM private key for auto-paying x402 requests
  • SENTIMENT402_X402_MAX_PAYMENT (optional) — max payment in base units (default 100000, i.e. $0.10 USDC)

No API keys are required for the Sentiment402 API. The private key is only needed if you want auto-pay for 402 responses.

Run locally

Build and start:

pnpm install
pnpm build
pnpm start

You can also run directly in dev mode:

pnpm dev

To point at localhost:

SENTIMENT402_API_BASE_URL="http://localhost:8080" pnpm dev

MCP host config example

Example for a stdio MCP host configuration:

{
  "command": "node",
  "args": ["/path/to/sentiment402/mcp/dist/index.js"],
  "env": {
    "SENTIMENT402_API_BASE_URL": "https://sentiment-api.kytona.com",
    "SENTIMENT402_API_VERSION": "v1"
  }
}

Client Setup Instructions

Claude Desktop

Claude Desktop supports MCP servers via stdio configuration.

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Option 1: Run from GitHub (Recommended)

{
  "mcpServers": {
    "sentiment402": {
      "command": "npx",
      "args": ["-y", "github:kytona/mcp"],
      "env": {
        "SENTIMENT402_API_VERSION": "v1",
        "SENTIMENT402_X402_PRIVATE_KEY": "your_evm_private_key_here"
      }
    }
  }
}

This automatically downloads and runs the latest version from GitHub.

Option 2: Run from Local Clone

  1. Clone and build:

    git clone https://github.com/kytona/mcp.git
    cd mcp
    pnpm install
    pnpm build
    
  2. Configure Claude:

    {
      "mcpServers": {
        "sentiment402": {
          "command": "node",
          "args": ["/absolute/path/to/mcp/dist/index.js"],
         "env": {
           "SENTIMENT402_API_VERSION": "v1",
           "SENTIMENT402_X402_PRIVATE_KEY": "your_evm_private_key_here"
         }
        }
      }
    }
    
  3. Restart Claude Desktop and look for the 🔌 icon to see available tools.

Resources:

ChatGPT Desktop

ChatGPT supports MCP via Developer Mode (requires ChatGPT Plus).

Setup Steps

  1. Enable Developer Mode:

    • Open ChatGPT → Settings
    • Go to Apps & ConnectorsAdvanced settings
    • Enable Developer mode
  2. Add MCP Server (NPX - Recommended):

    • In Apps & Connectors, click Create
    • Enter:
      • Name: Sentiment402
      • Command: npx
      • Args: -y github:kytona/mcp
      • Environment Variables:
        SENTIMENT402_API_VERSION=v1
        SENTIMENT402_X402_PRIVATE_KEY=your_evm_private_key_here
        
    • Check I trust this application
    • Click Create
  3. Use in Chat:

    • Click the + in the prompt field
    • Go to MoreDeveloper mode
    • Enable the Sentiment402 connector

Using Local Clone

  1. Clone and build as described above for Claude
  2. In ChatGPT Developer mode, configure:
    • Command: node
    • Args: /absolute/path/to/mcp/dist/index.js
    • Environment Variables: Same as above

Resources:

Running on a Cloud Server

To run the MCP server remotely and connect from Claude/ChatGPT:

1. Deploy to Cloud

# On your cloud server (AWS, DigitalOcean, etc.)
git clone https://github.com/kytona/mcp.git
cd mcp
pnpm install
pnpm build

# Run with PM2 for persistence
npm install -g pm2
pm2 start dist/index.js --name sentiment402-mcp
pm2 save
pm2 startup

2. Expose via ngrok (Development Only)

# Install ngrok: https://ngrok.com/download
ngrok tcp 8000

# Note the forwarding address: tcp://0.tcp.ngrok.io:12345

3. Configure Client

For Claude or ChatGPT, update the command to connect via TCP:

{
  "command": "node",
  "args": ["-e", "const net = require('net'); const client = net.connect({host: '0.tcp.ngrok.io', port: 12345}); process.stdin.pipe(client); client.pipe(process.stdout);"]
}

⚠️ Security Warning: ngrok exposes your server publicly. For production, use:

  • VPN (Tailscale, WireGuard)
  • SSH tunneling
  • Proper authentication middleware

Resources:

Other MCP Clients (Cline, etc.)

For other MCP-compatible clients, use a similar stdio configuration:

{
  "mcpServers": {
    "sentiment402": {
      "command": "npx",
      "args": ["-y", "github:kytona/mcp"],
      "env": {
        "SENTIMENT402_API_VERSION": "v1"
      }
    }
  }
}

Refer to your client's documentation for the exact config file location.

Test script

The repo includes a stdio test runner that calls a tool and prints the response.

pnpm build
pnpm test:mcp

To point at localhost:

SENTIMENT402_API_BASE_URL="http://localhost:8080" pnpm test:mcp

Optional overrides:

  • SENTIMENT402_MCP_TOOL (default get_global_snapshot)
  • SENTIMENT402_MCP_TOOL_ARGS (JSON string)
  • SENTIMENT402_MCP_SERVER_CMD / SENTIMENT402_MCP_SERVER_ARGS to customize the server process

License

MIT. See LICENSE.

Safety notes

  • The adapter only calls the public HTTPS API and never touches internal databases.
  • The MCP response body contains only the API response or a PAYMENT_REQUIRED payload.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选