DSPy Tools

v1.0.0Developer Toolsstable

Dspy built MCP tools on a FastAPI server connected to a Golang server, client and cli

dspy-mcp-toolsmcpai-integration
Share:
8
Stars
0
Downloads
0
Weekly
0/5

What is DSPy Tools?

DSPy Tools is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to dspy built mcp tools on a fastapi server connected to a golang server, client and cli

Dspy built MCP tools on a FastAPI server connected to a Golang server, client and cli

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Dspy built MCP tools on a FastAPI server connected to a Gola

Use Cases

Use DSPy optimization tools through FastAPI and MCP.
marcusjihansson

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedJan 28, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx dspy-mcp-tools

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use DSPy Tools

DSPy MCP Tools is a financial analysis platform that combines DSPy-optimized AI pipelines with a FastAPI Python server and a Go-based API server, CLI, and job queue. It exposes stock price analysis, market sentiment, company fundamentals, regulatory compliance, and macro economic tools through MCP, with support for both OpenRouter-backed LLMs and local Ollama models via a PostgreSQL-backed RAG system.

Prerequisites

  • Python 3.10+ and Go 1.21+ installed
  • PostgreSQL database running (for RAG/regulatory analysis)
  • Alpaca API key and secret for market data
  • OpenRouter API key (or local Ollama install) for LLM backend
  • uv or pip for Python dependency management
1

Clone the repository

Clone the dspy-mcp-tools repository and enter the project directory.

git clone https://github.com/marcusjihansson/dspy-mcp-tools.git
cd dspy-mcp-tools
2

Set up the Python environment and install dependencies

Create a virtual environment and install all required Python packages including FastAPI, DSPy, and Alpaca client libraries.

python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\Activate.ps1
pip install fastapi uvicorn pydantic dspy-ai python-dotenv requests pandas numpy alpaca-py psycopg2-binary ollama
3

Configure environment variables

Copy the example environment file and fill in your API credentials and database connection details.

cp .env.example .env

# Required .env keys:
# PORT=8080
# PYTHON_HOST=localhost
# PYTHON_PORT=8000
# TIMEOUT_SECONDS=30
# CHATBOT_KEY=<your-openrouter-api-key>
# DB_HOST=localhost
# DB_USER=<pg-user>
# DB_PASSWORD=<pg-password>
# DB_NAME=<database-name>
# ALPACA_API_KEY=<alpaca-key>
# ALPACA_API_SECRET=<alpaca-secret>
4

Build and start the Go server

Compile the Go components (server, job queue, security module, CLI, and client) and then start the Go API server.

go build server.go jobqueue.go security.go
go build cli.go client.go
go run server.go
5

Start the FastAPI Python server

In a separate terminal, activate the virtual environment and start the FastAPI server that hosts the DSPy-powered analysis tools.

source .venv/bin/activate
python fast_server.py
6

Configure Claude Desktop

Add the DSPy MCP tools server to your Claude Desktop configuration. Since the server runs locally, point your MCP config to the Go server port.

{
  "mcpServers": {
    "dspy-mcp-tools": {
      "command": "npx",
      "args": ["dspy-mcp-tools"]
    }
  }
}
7

Verify the server is healthy

Test that both servers are running and responding before connecting through Claude.

curl http://localhost:8080/health
curl http://localhost:8080/mcp/tools

DSPy Tools Examples

Client configuration

Claude Desktop configuration for the DSPy MCP Tools server.

{
  "mcpServers": {
    "dspy-mcp-tools": {
      "command": "npx",
      "args": ["dspy-mcp-tools"]
    }
  }
}

Prompts to try

Use these prompts with Claude once the DSPy financial analysis tools are available.

- "Analyze AAPL stock price from 2024-01-01 to 2024-06-01 and identify key trends"
- "What is the current market sentiment for NVDA based on recent news?"
- "Generate a company profile for Microsoft including fundamental metrics"
- "Run a regulatory compliance check on TSLA and summarize any flagged issues"

Troubleshooting DSPy Tools

Go server fails to connect to the FastAPI Python server

Ensure the FastAPI server is started first in a separate terminal and is listening on the port specified by PYTHON_PORT in .env (default 8000). Check that PYTHON_HOST and PYTHON_PORT in .env match the actual FastAPI server address.

Alpaca API returns empty or error responses for price data

Verify ALPACA_API_KEY and ALPACA_API_SECRET are set correctly in .env. Ensure you have a valid Alpaca account with market data access enabled. Free-tier Alpaca accounts may have delayed data; use paper trading credentials for testing.

DSPy optimization errors on startup

Ensure dspy-ai is installed with 'pip install dspy-ai' and that CHATBOT_KEY (OpenRouter API key) is set in .env. If using Ollama locally, ensure the Ollama service is running and the desired model has been pulled with 'ollama pull <model-name>'.

Frequently Asked Questions about DSPy Tools

What is DSPy Tools?

DSPy Tools is a Model Context Protocol (MCP) server that dspy built mcp tools on a fastapi server connected to a golang server, client and cli It connects AI assistants to external tools and data sources through a standardized interface.

How do I install DSPy Tools?

Follow the installation instructions on the DSPy Tools GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with DSPy Tools?

DSPy Tools works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is DSPy Tools free to use?

Yes, DSPy Tools is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "dspy-mcp-tools": { "command": "npx", "args": ["-y", "dspy-mcp-tools"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use DSPy Tools?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides