Supports containerized deployment through Docker, enabling portable and isolated running of the SpaceTraders MCP server.
Uses .ENV for configuration and API key management, allowing storage of SpaceTraders API credentials securely outside of code.
Hosted on GitHub, allowing users to clone the repository and access the SpaceTraders MCP server code.
Built on Python, requiring version 3.12+ for server implementation and SpaceTraders API interactions.
SpaceTraders MCP Server
A Model Context Protocol (MCP) server for interacting with the SpaceTraders API. This server exposes SpaceTraders API endpoints as MCP tools, allowing AI agents to manage agents, fleets, contracts, and trading operations in the SpaceTraders universe.
Overview
This project provides an MCP server that enables AI agents to:
- Register and manage SpaceTraders agents
- View and manage ships and fleets
- Accept, deliver, and fulfill contracts
- Trade resources and interact with markets
- Explore systems, waypoints, and shipyards
The implementation is based on the MCP standard, using the mcp
Python package for server infrastructure.
Features
- Register new SpaceTraders agents
- View agent details and list agents
- List, view, accept, deliver, and fulfill contracts
- List ships, view ship details, purchase ships
- Navigate, dock, orbit, refuel, and extract resources with ships
- Transfer and sell cargo
- Scan systems, waypoints, and ships
- View markets and shipyards
- Chart waypoints and refine resources
See TODO.md
for a detailed checklist of implemented and missing endpoints.
Prerequisites
- Python 3.12+
- SpaceTraders API key (from https://my.spacetraders.io)
- Docker (optional, for containerized deployment)
Installation
Using uv
- Install uv if you don't have it:
- Clone this repository:
- Install dependencies:
- Create a
.env
file in the project root and add your SpaceTraders API key:
Using Docker (optional)
- Build the Docker image:
- Create a
.env
file in the project root and add your SpaceTraders API key.
Configuration
The following environment variable is required:
Variable | Description |
---|---|
SPACETRADERS_API_KEY | Your SpaceTraders account token |
Running the Server
Using uv
Using Docker
MCP Integration
This server exposes SpaceTraders API endpoints as MCP tools. You can connect to it from any MCP-compatible client. Example configuration (update URL/port as needed):
Project Structure
src/main.py
— Main MCP server implementation and tool definitionssrc/spacetraders_utils.py
— SpaceTraders API client and token managementsrc/utils.py
— Utility functionsagent_tokens.json
— Persistent agent tokens (auto-managed)schemas/
— OpenAPI and reference JSON files for SpaceTraders APIpublic/
— Static assetsTODO.md
— Endpoint implementation checklist
Schemas and Reference Data
The schemas/
directory contains large JSON files used for reference and development:
schemas/SpaceTraders.json
— The official OpenAPI specification for the SpaceTraders API (v2). Used for endpoint reference and validation.schemas/SpaceTraderFullAPI.json
— (Describe usage here if different, or remove if unused.)
These files are not required for running the server, but are useful for development, code generation, and documentation.
Development Status
See TODO.md
for a list of implemented and missing endpoints. The core gameplay and trading endpoints are implemented; some advanced features are still TODO.
This project is licensed under the terms described in the LICENSE file included in this repository.
This server cannot be installed
An MCP server that enables AI agents to interact with the SpaceTraders API, managing agents, fleets, contracts, and trading operations in the SpaceTraders universe.
Related MCP Servers
- AsecurityAlicenseAqualityMCP server that provides AI assistants access to stock market data including financial statements, stock prices, and market news through a Model Context Protocol interface.Last updated -11433PythonMIT License
- AsecurityFlicenseAqualityAn MCP server that enables AI models like Claude to interact with the Trading Simulator API for checking balances, viewing prices, and executing trades with automatic chain detection.Last updated -15TypeScript
Armor Crypto MCPofficial
AsecurityAlicenseAqualityAn MCP server providing unified access to blockchain operations, bridging, swapping, and crypto trading strategies for AI agents.Last updated -20177PythonGPL 3.0- PythonMIT License