Skip to content

Repository files navigation

📈 MemePortfolio MCP Server

MCP Server Name: MemePortfolio MCP

Category: DeFi / Solana / Meme Tokens / Portfolio Management

Status: Public tools – Private backend

Access: Pay-per-call via x402

Server URL: [https://mcp.memeportfolio.io/mcp]

Website: [https://MemePortfolio.io]

Twitter: [https://x.com/MemePortfolio1]

Blog: [https://blog.memeportfolio.io/blog/]

mcp-name: io.github.MemePortfolio/memeportfolio-mcp


📖 Description

The MemePortfolio MCP Server provides AI-powered tools to interact with MemePortfolio's Solana meme token portfolio engine.

Developers and AI agents can integrate these tools through the MCP protocol to build optimal Markowitz portfolios of Solana meme tokens and analyse existing wallet holdings - including token balances, prices, and risk metrics.

All tools follow the Model Context Protocol (MCP) and can be consumed via any MCP-compatible client.


⚙️ Available Tools

1. Create Markowitz Portfolio Tool

ID: create_markowitz_portfolio

Description: Creates an optimal Markowitz mean-variance portfolio of Solana meme tokens. The algorithm selects and weights tokens to maximise the Sharpe ratio, balancing expected return against volatility.

Use this when a user wants an optimised meme token portfolio built from quantitative analysis.

➡️ Example Use Cases:

• "Build me an optimal Solana meme token portfolio with 10 tokens."
• "What is the best allocation across meme tokens right now?"
• "Create a Markowitz portfolio for Solana meme coins."

Inputs:

Name Type Required Default Constraints
number_of_tokens int No 10 Min: 2, Max: 50

Outputs (JSON):

{
  "portfolio": [
    {
      "symbol": "string",             // token ticker symbol (e.g. "BONK")
      "chain": "string",              // blockchain network (e.g. "SOLANA")
      "weight": 0.0,                  // portfolio allocation weight as a percentage
      "annual_return": 0.0,           // annualised expected return (%)
      "annual_volatility": 0.0,       // annualised volatility (%)
      "sharpe_ratio": 0.0,            // Sharpe ratio
      "sortino_ratio": 0.0            // Sortino ratio
    }
  ],
  "portfolio_metrics": {
    "total_tokens": 0,                // number of tokens in portfolio
    "annual_return": 0.0,             // portfolio-level annualised return (%)
    "annual_volatility": 0.0,         // portfolio-level annualised volatility (%)
    "sharpe_ratio": 0.0,              // portfolio Sharpe ratio
    "sortino_ratio": 0.0,             // portfolio Sortino ratio
    "total_weight": 100.0             // sum of all weights (always 100)
  }
}

Error cases:

• `400 Bad Request` → invalid `number_of_tokens` value
• `500 Internal Server Error` → temporary downstream failure

2. Get Portfolio Tool

ID: get_portfolio

Description: Returns token balances, current prices, USD values, and risk metrics for a user's existing Solana meme token portfolio identified by wallet address.

Use this when a user wants to understand their current holdings and the risk/return profile of each position.

➡️ Example Use Cases:

• "What meme tokens do I hold and what are they worth?"
• "Show me the risk metrics for my Solana wallet."
• "Analyse the portfolio for wallet address ABC123..."

Inputs:

Name Type Required Constraints
wallet string Valid Solana public key (base58, 32–44 chars)

Outputs (JSON):

{
  "token_metrics": [
    {
      "symbol": "string",             // token ticker symbol (e.g. "BONK")
      "chain": "string",              // blockchain network (e.g. "SOLANA")
      "contractAddress": "string",    // token contract / mint address
      "balance": 0,                   // token balance held by wallet
      "price": 0.0,                   // current token price in USD
      "value": 0.0,                   // current USD value of holding
      "metrics": {
        "weight": 0.0,                // portfolio weight as a percentage
        "annual_return": 0.0,         // annualised expected return (%)
        "annual_volatility": 0.0,     // annualised volatility (%)
        "sharpe_ratio": 0.0,          // Sharpe ratio
        "sortino_ratio": 0.0          // Sortino ratio
      }
    }
  ],
  "portfolio_metrics": {
    "total_tokens": 0,                // number of distinct tokens held
    "annual_return": 0.0,             // portfolio-level annualised return (%)
    "annual_volatility": 0.0,         // portfolio-level annualised volatility (%)
    "sharpe_ratio": 0.0,              // portfolio Sharpe ratio
    "sortino_ratio": 0.0,             // portfolio Sortino ratio
    "total_weight": 100.0             // sum of all weights (always 100)
  }
}

Error cases:

• `400 Bad Request` → invalid or malformed `wallet` address
• `500 Internal Server Error` → temporary downstream failure

🧠 Example Client Usage

Node.js Example

import { MCPClient } from "mcp-client";

const client = new MCPClient("https://mcp.memeportfolio.io/mcp");

const result = await client.call("create_markowitz_portfolio", {
  number_of_tokens: 10
});

console.log(result);

Python Example

from mcp_client import MCPClient

client = MCPClient("https://mcp.memeportfolio.io/mcp")

res = client.call("get_portfolio", {
  "wallet": "YourSolanaPublicKeyHere"
})
print(res)

Service Configuration:

{
  "mcpServers": {
    "memeportfolio-mcp": {
      "type": "http",
      "url": "https://mcp.memeportfolio.io/mcp",
      "description": "The MemePortfolio MCP Server provides tools to build optimal Markowitz portfolios of Solana meme tokens and analyse existing wallet holdings.",
      "auth": {
        "type": "x402"
      }
    }
  }
}

🔌 Integration Notes

  • ✅ Compatible with MCP clients across Node.js, Python, and browser-based environments
  • 🔁 Uses Streamable HTTP transport (POST /mcp) per the MCP specification
  • 📐 JSON schemas conform to the MCP specification
  • 🚦 Rate limits may apply depending on usage tier
  • 💳 x402 payments - pay-per-call via the x402 protocol; compatible x402 clients handle payment automatically on HTTP 402 responses

Claude Code (CLI) Configuration

Use the Claude CLI to register the MCP server via Streamable HTTP transport:

claude mcp add --transport http memeportfolio-mcp-server https://mcp.memeportfolio.io/mcp

📚 Documentation: https://code.claude.com/docs/en/mcp


ChatGPT Connector Configuration

Available in ChatGPT environments that support Connectors / MCP (Developer Mode).

Steps

  1. Open ChatGPT Settings
  2. Navigate to Apps / Connectors
  3. Click Add Connector
  4. Enter the integration name and URL below
  5. Save the configuration

Integration Details

Name

MemePortfolio MCP Server

Integration URL

https://mcp.memeportfolio.io/mcp

Claude Web & Claude Desktop Configuration

Steps

  1. Open Claude Web or Claude Desktop
  2. Go to Settings → Integrations
  3. Click Add integration
  4. Enter the name and URL below
  5. Click Add to complete setup

Integration Details

Name

MemePortfolio MCP Server

Integration URL

https://mcp.memeportfolio.io/mcp

📚 Documentation: https://platform.claude.com/docs/en/agents-and-tools/remote-mcp-servers


Cursor Configuration

Add the MCP server to your Cursor configuration file (e.g. mcp.json):

{
  "mcpServers": {
    "memeportfolio-mcp-server": {
      "url": "https://mcp.memeportfolio.io/mcp",
      "transport": "http"
    }
  }
}

📚 Documentation: https://cursor.com/docs/context/mcp


🤖 Claude Code Subagents

This repository includes 2 ready-to-use Claude Code subagents in .claude/agents/ - specialist agents that handle Solana meme token portfolio tasks out of the box.

Agent Purpose
memeportfolio-portfolio-builder Builds an optimal Markowitz portfolio of Solana meme tokens
memeportfolio-portfolio-analyzer Analyses existing wallet meme token holdings

Setup

Step 1 - Connect the MCP server

claude mcp add --transport http memeportfolio-mcp-server https://mcp.memeportfolio.io/mcp

For Cursor / Windsurf, add to mcp.json:

{
  "mcpServers": {
    "memeportfolio-mcp-server": {
      "url": "https://mcp.memeportfolio.io/mcp",
      "transport": "http"
    }
  }
}

Step 2 - Copy the agent files

git clone https://github.com/MemePortfolio/memeportfolio-mcp.git
cp -r memeportfolio-mcp/.claude/agents/ your-project/.claude/agents/

Running Locally

Prerequisites: Node.js 18+

  1. Clone the repo and install dependencies:
npm install
  1. Run in development mode:
npm run dev
  1. Build for production:
npm run build
  1. Run the built server:
node dist/index.js
  1. Test with MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js

🔒 Access Policy

The MCP server uses x402 pay-per-call access - no subscription or API key required. Any x402-compatible MCP client will handle payment automatically when the server returns HTTP 402.


🤝 A2A Protocol (Agent-to-Agent)

The server implements Google's A2A protocol for direct agent-to-agent interoperability - no MCP client required.

Agent card discovery:

GET https://mcp.memeportfolio.io/.well-known/agent.json

Endpoints:

Method Path Description
GET /.well-known/agent.json Agent card - capabilities, skills, and provider metadata
POST /a2a/tasks/send Submit a task, receive the completed result in one response
POST /a2a/tasks/sendSubscribe Submit a task, receive SSE state-transition events
GET /a2a/tasks/{task_id} Poll task state by ID

Skills:

Skill ID Maps to Required input Optional input
create-markowitz-portfolio create_markowitz_portfolio - number_of_tokens (int, 2-50)
get-portfolio get_portfolio wallet (Solana public key) -

Example task request:

{
  "id": "task-001",
  "skillId": "create-markowitz-portfolio",
  "message": {
    "parts": [{
      "type": "data",
      "data": { "number_of_tokens": 10 }
    }]
  }
}

Both skills complete synchronously. The sendSubscribe endpoint emits submittedworkingcompleted events.


🔗 Framework Integrations


📖 Further Reading


🧾 License

MIT (for client examples). Server implementation and backend logic are proprietary and remain private.

memeportfolio-mcp MCP server

About

Return/Risk optimized portfolios for the Memes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors