Skip to content
Open
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
3 changes: 3 additions & 0 deletions zereus-mcp/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# API Configuration
ZEREUS_API_URL=https://api-url-here.com
ZEREUS_API_KEY=your-api-key-here
7 changes: 7 additions & 0 deletions zereus-mcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.env
.DS_Store
.vscode
dist
build
package-lock.json
81 changes: 81 additions & 0 deletions zereus-mcp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Zereus MCP - Crypto Market Intelligence for Claude

A Model Context Protocol server that exposes Zereus's zAI market intelligence capabilities to Claude Desktop and other AI assistants.

Zereus MCP connects [Anthropic's Claude](https://www.anthropic.com/claude) to Zereus zAI market intelligence via the Model Context Protocol (MCP). This integration delivers real-time crypto sentiment analysis, token metrics, and trend detection directly in conversations with Claude.

This repository contains the MCP server implementation that enables Claude to access Zereus' crypto market intelligence.

NOTE - API KEY is required for this to work. Please contact Zereus team for the API key, for demo purposes we have included a video below.

## Features

- **Real-time Sentiment Analysis**: Get instant sentiment analysis for any crypto token
- **Seamless Claude Integration**: Access market insights directly in your Claude conversations
- **Developer-friendly**: Simple API for integrating crypto intelligence into your applications

## Demo

This MCP server is a demonstration of our upcoming B2B API suite, which includes:

- Text-based analysis through Claude (this repository)
- GUI dashboard connected to our API suite
- 18+ specialized endpoints for comprehensive market intelligence

Check out our [announcement tweet](https://x.com/zereusai/status/1901096538233074156) for a preview!

## Quick Setup

1. Clone this repository:
```bash
git clone https://github.com/elitexape/zereus-mcp.git
cd zereus-mcp
```

2. Install dependencies:
```bash
npm install
```

3. Build the project:
```bash
npm run build
```

4. Configure Claude Desktop:
- For macOS:
```bash
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
```
- For Windows:
```bash
code %APPDATA%\Claude\claude_desktop_config.json
```

5. Update the Claude Desktop configuration with:
```json
{
"mcpServers": {
"zereus": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/YOUR/zereus-mcp/build/index.js"
]
}
}
}
```

6. Restart Claude Desktop

## Usage Examples

Once set up, you can ask Claude Desktop questions like:

- "What's the current sentiment analysis for BONK token?"
- "What's the sentiment analysis for TRUMP token?"
- "Analyze the sentiment for SOL token"

## Social

- Twitter: [@zereusai](https://twitter.com/zereusai)
36 changes: 36 additions & 0 deletions zereus-mcp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "zereus-mcp-server",
"version": "1.0.0",
"description": "MCP server for Zereus zAI market intelligence",
"main": "build/index.js",
"type": "module",
"bin": {
"zereus-mcp": "./build/index.js"
},
"scripts": {
"build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\"",
"start": "node build/index.js"
},
"keywords": [
"zereus",
"solana",
"mcp",
"model-context-protocol",
"ai",
"market-intelligence"
],
"author": "Zereus",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.5.0",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^5.0.1",
"node-fetch": "^3.3.2",
"zod": "^3.24.2"
},
"devDependencies": {
"@types/node": "^22.13.4",
"typescript": "^5.7.3"
}
}
140 changes: 140 additions & 0 deletions zereus-mcp/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
// src/index.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import dotenv from "dotenv";
import fetch from "node-fetch";

// Load environment variables
dotenv.config();

// API configuration
const API_URL = "http://localhost:5050"; //for local demonstration, final Public URL will be provided by Zereus team once the B2B suite is live

// Create server with proper initialization
const server = new McpServer({
name: "Zereus-zAI",
version: "1.0.0"
});

/**
* Function to get sentiment analysis for a token
* @param {string} tokenSymbol - The symbol of the token to analyze
* @returns {Promise<object>} - The sentiment analysis data
*/
async function getSentimentAnalysis(tokenSymbol) {
try {
console.error(`Calling sentiment analysis API for ${tokenSymbol}...`);

const endpoint = `${API_URL}/api/v1/sentiment-analysis`;
console.error(`URL: ${endpoint}`);

// Create request body
const requestBody = {
query: tokenSymbol,
timeframe: "12 Hours"
};

console.error(`Request body: ${JSON.stringify(requestBody)}`);

const response = await fetch(endpoint, {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Z-XAPI": "API-KEY" //Procure your API key by contacting team, or MB @ t.me/mitulbharti
},
body: JSON.stringify(requestBody)
});

console.error(`Response status: ${response.status}`);

if (!response.ok) {
const errorText = await response.text();
console.error(`API error response: ${errorText}`);
throw new Error(`API request failed with status ${response.status}: ${errorText}`);
}

const data = await response.json();
console.error(`API response data: ${JSON.stringify(data, null, 2)}`);
return data;
} catch (error) {
console.error("Error fetching sentiment analysis:", error);
throw error;
}
}

// Register only the sentiment analysis tool
server.tool(
"getSentimentAnalysis",
{ tokenSymbol: z.string().describe("The symbol of the token to analyze (e.g., 'SOL', 'BONK', 'TRUMP')") },
async ({ tokenSymbol }) => {
try {
console.error(`Tool called: getSentimentAnalysis with tokenSymbol=${tokenSymbol}`);
const data = await getSentimentAnalysis(tokenSymbol);

// Extract data with flexible path handling
const typedData = data as { data?: { sentimentAnalysis?: unknown }; sentimentAnalysis?: unknown };
let result;
if (typedData.data?.sentimentAnalysis) {
result = typedData.data.sentimentAnalysis;
} else if (typedData.sentimentAnalysis) {
result = typedData.sentimentAnalysis;
} else {
result = typedData;
}

console.error(`Returning result: ${JSON.stringify(result, null, 2)}`);
return {
content: [{
type: "text",
text: typeof result === 'string' ? result : JSON.stringify(result, null, 2)
}]
};
} catch (error) {
console.error(`Error calling getSentimentAnalysis:`, error);
return {
content: [{
type: "text",
text: `Error: ${error.message}`
}],
isError: true
};
}
}
);

// Connect and listen
async function main() {
try {
// Print debug information
console.error("Starting Zereus MCP Server...");
console.error(`API URL: ${API_URL}`);

// Create transport
console.error("Creating transport...");
const transport = new StdioServerTransport();

// Connect to transport
console.error("Connecting to transport...");
await server.connect(transport);

console.error("✅ Zereus MCP Server is running...");
console.error("🔌 Claude can now access Zereus zAI market intelligence");
} catch (err) {
console.error("❌ Failed to start MCP server:", err);
console.error("Stack trace:", err.stack);
process.exit(1);
}
}

// Add process error handlers
process.on('uncaughtException', (err) => {
console.error('Uncaught exception:', err);
console.error(err.stack);
});

process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
});

main();
17 changes: 17 additions & 0 deletions zereus-mcp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "./build",
"strict": false,
"esModuleInterop": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"noImplicitAny": false
},
"include": ["src/**/*"],
"exclude": ["node_modules", "build"]
}