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.
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:fullorcompact_tradingfields: comma-separated allowlist (only meaningful whenformat=compact_trading)symbol: required forget_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:
60000ms - Cache key:
{tool}:{path}?{query} - Only
2xxJSON responses are cached 402responses are never cached
Configuration
Defaults:
- API base URL:
https://sentiment-api.kytona.com - API version:
v1
Environment variables:
SENTIMENT402_API_BASE_URL(optional) — defaulthttps://sentiment-api.kytona.comSENTIMENT402_API_VERSION(optional) —v1(defaultv1)SENTIMENT402_CACHE_TTL_MS(optional) — cache TTL in ms (default60000)SENTIMENT402_USER_AGENT(optional) — defaultsentiment402-mcp/0.1.0SENTIMENT402_X402_PRIVATE_KEY(optional) — EVM private key for auto-paying x402 requestsSENTIMENT402_X402_MAX_PAYMENT(optional) — max payment in base units (default100000, 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
-
Clone and build:
git clone https://github.com/kytona/mcp.git cd mcp pnpm install pnpm build -
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" } } } } -
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
-
Enable Developer Mode:
- Open ChatGPT → Settings
- Go to Apps & Connectors → Advanced settings
- Enable Developer mode
-
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
- Name:
- Check I trust this application
- Click Create
-
Use in Chat:
- Click the + in the prompt field
- Go to More → Developer mode
- Enable the Sentiment402 connector
Using Local Clone
- Clone and build as described above for Claude
- In ChatGPT Developer mode, configure:
- Command:
node - Args:
/absolute/path/to/mcp/dist/index.js - Environment Variables: Same as above
- Command:
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(defaultget_global_snapshot)SENTIMENT402_MCP_TOOL_ARGS(JSON string)SENTIMENT402_MCP_SERVER_CMD/SENTIMENT402_MCP_SERVER_ARGSto 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_REQUIREDpayload.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.