Skip to content

Latest commit

 

History

67 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Servers Collection

This repository contains a collection of Model Context Protocol (MCP) servers that can be used with Amazon Q, Claude Desktop, and other LLMs that support the MCP protocol.

Available MCP Servers

  • Capital.com MCP Server: Exposes the Capital.com trading API as MCP tools for trading operations

    • Search for markets (e.g., EURUSD, AAPL)
    • Get account information and positions
    • Create and manage trading positions
    • Access watchlists
  • eToro MCP Server: Exposes the eToro trading API as MCP tools for trading operations

    • Search for instruments by name, symbol, or category
    • Get account information (balance, equity, margin)
    • Get and manage open trading positions
    • Create positions with leverage, stop loss, and take profit
    • Get real-time bid/ask prices for instruments
    • Access detailed instrument metadata (trading hours, spreads, limits)

What is MCP?

Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to LLMs. MCP enables communication between the system and locally running MCP servers that provide additional tools and resources to extend LLM capabilities.

Prerequisites

Make sure you have uv installed on your system:

curl -LsSf https://astral.sh/uv/install.sh | sh

Using with Amazon Q

  1. Create an mcp.json configuration file in your Amazon Q configuration directory (~/.aws/amazonq/mcp.json):

    {
      "mcpServers": {
        "capital-com-mcp-server": {
          "command": "uvx",
          "args": ["capital-com-mcp-server"],
          "env": {
            "CAPITAL_BASE_URL": "https://demo-api-capital.backend-capital.com",
            "CAPITAL_API_KEY": "your_api_key_here",
            "CAPITAL_PASSWORD": "your_password_here",
            "CAPITAL_IDENTIFIER": "your_email@example.com",
            "FASTMCP_LOG_LEVEL": "ERROR"
          }
        },
        "etoro-mcp-server": {
          "command": "uvx",
          "args": ["etoro-mcp-server"],
          "env": {
            "ETORO_API_KEY": "your_public_app_key_here",
            "ETORO_USER_KEY": "your_user_key_here",
            "ETORO_ACCOUNT_TYPE": "demo",
            "FASTMCP_LOG_LEVEL": "ERROR"
          }
        }
      }
    }
  2. Run Amazon Q with:

    q chat
  3. Amazon Q will automatically start the MCP server and connect to it.

Using with Claude Desktop

  1. In Claude Desktop, go to Settings > Developer section and click on "Edit Config"

  2. This will open the configuration file. Add the following to the JSON:

    {
      "mcpServers": {
        "capital-com-mcp-server": {
          "command": "uvx",
          "args": ["capital-com-mcp-server"],
          "env": {
            "CAPITAL_BASE_URL": "https://demo-api-capital.backend-capital.com",
            "CAPITAL_API_KEY": "your_api_key_here",
            "CAPITAL_PASSWORD": "your_password_here",
            "CAPITAL_IDENTIFIER": "your_email@example.com",
            "FASTMCP_LOG_LEVEL": "ERROR"
          }
        },
        "etoro-mcp-server": {
          "command": "uvx",
          "args": ["etoro-mcp-server"],
          "env": {
            "ETORO_API_KEY": "your_public_app_key_here",
            "ETORO_USER_KEY": "your_user_key_here",
            "ETORO_ACCOUNT_TYPE": "demo",
            "FASTMCP_LOG_LEVEL": "ERROR"
          }
        }
      }
    }
  3. Save the file and restart Claude Desktop.

Example Conversations

Capital.com

You: Search for Apple stock on Capital.com

AI: I'll search for Apple stock on Capital.com for you.

[Uses capital-com-mcp-server___search_markets tool]

I found Apple Inc. (AAPL) on Capital.com. Here are the details:
- Epic: AAPL
- Market name: Apple Inc.
- Current bid price: $184.25
- Current ask price: $184.30
- Market status: OPEN

Would you like me to get more information about this stock or perform any trading operations?

eToro

You: Search for Apple stock on eToro

AI: I'll search for Apple stock on eToro for you.

[Uses search_instruments tool with search_term="Apple"]

I found Apple Inc. on eToro. Here are the details:
- Instrument ID: 1001
- Name: Apple Inc.
- Symbol: AAPL
- Category: Stocks
- Current price: $184.25
- Market status: OPEN

Note: The instrument ID (1001) is what you'll need for trading operations.
You: Buy $1000 worth of Bitcoin with 2x leverage and set a stop loss at $60,000

AI: I'll create a Bitcoin position with your specified parameters.

[Uses search_instruments to find Bitcoin instrument ID, then create_position]

Successfully created a BUY position for Bitcoin:
- Position ID: pos_abc123
- Instrument ID: 2045 (Bitcoin)
- Amount: $1,000
- Leverage: 2x
- Stop loss: $60,000
- Status: OPEN
- Current P&L: $0.00

The position is now active and being monitored.

Repository Structure

Each MCP server is organized as a separate Python package under the src/ directory:

mcp-servers/
├── README.md
└── src/
    ├── capital_com_mcp_server/
    │   ├── README.md
    │   ├── pyproject.toml
    │   ├── capital_com_mcp_server/
    │   │   ├── __init__.py
    │   │   ├── capital_mcp_server.py
    │   │   └── capital_client.py
    │   └── ...
    └── etoro_mcp_server/
        ├── README.md
        ├── pyproject.toml
        ├── etoro_mcp_server/
        │   ├── __init__.py
        │   ├── etoro_mcp_server.py
        │   └── etoro_client.py
        └── ...

Development

To add a new MCP server to this collection:

  1. Create a new directory under src/ with your server name
  2. Add the necessary files for your MCP server implementation
  3. Include a pyproject.toml and setup.py in the server directory
  4. Add a README.md with usage instructions

Publishing

Each MCP server can be published to PyPI independently:

cd src/your_mcp_server
uv build
uv pip publish

GitHub Actions

This repository uses GitHub Actions to automatically build and publish packages to PyPI when a new release is created. The workflow is configured to use a matrix strategy, allowing each package to be built and published independently.

To add a new package to the publishing workflow, update the matrix in .github/workflows/python-publish.yml:

strategy:
  matrix:
    package: [capital_com_mcp_server, etoro_mcp_server]

Resources

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages