Thank you for your interest in contributing to the MCP Paradex Server project!
src/mcp_paradex/- Main packageserver/- MCP server implementationserver.py- FastMCP server configuration
resources/- Read-only data resourcessystem.py- System status resourcemarket.py- Market data resourcesvaults.py- Vault management resources
tools/- Action tools for operationssystem.py- System management toolsmarket.py- Market data toolsaccount.py- Account management toolsorders.py- Order management toolsvaults.py- Vault management tools
utils/- Utility functions and helpersconfig.py- Configuration handlingparadex_client.py- Paradex API client
-
Step 1: Create Basic Project Structure
- Set up package configuration and dependencies
- Create initial FastMCP server configuration
- Implement basic system health checks
-
Step 2: Implement Authentication Layer
- Design secure API key management system
- Create authentication flow for Paradex API
-
Step 3: Deploy Basic Server with Health Check
- Implement system status resource
- Create connectivity verification tool
- Add public API endpoints that don't require authentication
-
Step 4: Market Data Integration
- Implement market data resources
- Create market data tools
- Add orderbook and trade history functionality
-
Step 5: Account and Order Management
- Implement account information resources
- Create order management tools
- Add vault management capabilities
-
Step 6: Add Smithery.ai Support
- Create Smithery.ai configuration file
- Add Claude Desktop configuration example
- Document Smithery.ai integration
This project uses several tools to maintain code quality:
- Black: Code formatter that enforces a consistent style
- Ruff: Fast Python linter that combines functionality from multiple linting tools
- Mypy: Static type checker for Python
- Pre-commit: Git hook scripts to automate checks before commits
-
Install development dependencies:
make install-dev
-
Format code:
make format
-
Lint code:
make lint
-
Type check:
make typecheck
-
Run all checks:
make check
-
Run pre-commit on all files:
make pre-commit
-
Run tests:
make test -
Run tests with coverage report:
make test-cov
This project uses pytest for testing. Tests are located in the tests directory.
# Run all tests
make test
# OR
pytest
# Run tests with coverage report
make test-cov
# OR
pytest --cov=mcp_paradex --cov-report=htmlThis will generate an HTML coverage report in the htmlcov directory.
To test the MCP server during development:
# Run the server in development mode
uv run mcp-paradex
# Test with specific environment variables
PARADEX_ENVIRONMENT=testnet uv run mcp-paradex
# Test with Docker
docker build . -t mcp-paradex-local
docker run --rm -i mcp-paradex-localThe MCP Inspector is a debugging tool for testing MCP servers:
# Install MCP Inspector
npm install -g @anthropic/mcp-inspector
# Run inspector with your local server
mcp-inspector uv run mcp-paradex
# Or test with environment variables
mcp-inspector --env PARADEX_ENVIRONMENT=testnet uv run mcp-paradexThe inspector will open a web interface where you can:
- View available resources and tools
- Test tool calls interactively
- Debug server responses
- Check for errors or warnings
For testing with Claude Desktop during development:
- Update your
claude_desktop_config.jsonto use the local development server:
{
"mcpServers": {
"paradex-dev": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-paradex-py", "mcp-paradex"],
"env": {
"PARADEX_ENVIRONMENT": "testnet",
"PARADEX_ACCOUNT_PRIVATE_KEY": "your_test_private_key"
}
}
}
}- Restart Claude Desktop to load the new configuration
# Test system endpoints (no auth required)
curl -X POST http://localhost:8000/system/config
# Test with authentication (requires proper setup)
PARADEX_ACCOUNT_PRIVATE_KEY=your_key uv run mcp-paradex
# Test specific tools
python -c "from mcp_paradex.tools.system import paradex_system_config; print(paradex_system_config())"Create a .env.test file for testing:
# Copy template
cp .env.template .env.test
# Edit with test credentials
PARADEX_ENVIRONMENT=testnet
PARADEX_ACCOUNT_PRIVATE_KEY=your_test_private_key
# Use in tests
source .env.test
uv run mcp-paradex- Use
--verboseflag for detailed logging - Check server logs for authentication issues
- Test with testnet first before mainnet
- Use MCP Inspector's network tab to debug API calls
- Verify environment variables are loaded correctly
Test the full integration flow:
# 1. Start the server
uv run mcp-paradex &
SERVER_PID=$!
# 2. Test with a simple client
python -c "
from mcp import Client
import asyncio
async def test():
# Test basic connectivity
pass
asyncio.run(test())
"
# 3. Cleanup
kill $SERVER_PIDPre-commit hooks are configured to run automatically on git commit. They include:
- Trailing whitespace removal
- End-of-file fixer
- YAML/TOML syntax checking
- Black formatting
- Ruff linting
- Mypy type checking
To manually run all pre-commit hooks on all files:
pre-commit run --all-filesGenerate models.py
Convert paradex swagger to openapi using https://converter.swagger.io/#/Converter/convertByUrl
https://api.prod.paradex.trade/swagger/doc.json
pip install datamodel-code-generator
datamodel-codegen --input prompts/paradex-openapi.json --use-annotated --use-default-kwarg --keep-model-order --output src/mcp_paradex/models/- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure your code follows the existing style and passes all tests and linters before submitting a PR.
MCP Testing Framework - A comprehensive testing framework for MCP servers.
Before submitting a PR, ensure:
- All tests pass:
make test - Code coverage is maintained:
make test-cov - Linting passes:
make lint - Type checking passes:
make typecheck - Pre-commit hooks pass:
make pre-commit - MCP Inspector shows no errors
- Manual testing with Claude Desktop works
- Both testnet and mainnet configurations tested (if applicable)
- Authentication Errors: Ensure
PARADEX_ACCOUNT_PRIVATE_KEYis set correctly - Network Issues: Check if testnet/mainnet endpoints are accessible
- MCP Protocol Errors: Use MCP Inspector to debug protocol-level issues
- Environment Variables: Verify all required env vars are loaded
- Dependencies: Run
uv sync --dev --all-extrasto update dependencies