A MCP (Model Context Protocol) server that enables AI models to query location attestations using the Astral GraphQL endpoints and APIs
Project description
astral-api-mcp
A MCP (Model Context Protocol) server that enables AI models to query location attestations using the available Astral GraphQL endpoints and APIs.
Table of Contents
Project Overview
We are exploring the development of a Model Context Protocol (MCP) agent that integrates with the Astral API to enable intelligent querying and analysis of attestations submitted to blockchain ecosystems such as the Ethereum Attestation Service (EAS). This agent would support complex queries across spatial and temporal dimensions, such as filtering attestations by schema ID, location, or date range, while maintaining persistent context across sessions. By leveraging Astral’s structured API and EAS’s open schema model, the agent could automate common analytical workflows—like generating attestation heatmaps or tracking schema usage over time—making it a valuable tool for both research and production use cases. This early scoping phase would help assess feasibility and determine if this direction merits further investment.
To learn more, please refer to the following document for additional details on the purpose, use cases, architecture, and development plans.
Integration with the Recall Platform
Recall is a blockchain-based platform to support persistent, intelligent agents for onchain storage primitives and agent collaboration tools, enabling AI agents to maintain persistent memory, share data across sessions, and participate in a broader ecosystem of interconnected agents. By integrating the Astral MCP agent with Recall, we can transform it from a standalone location attestation query tool into a collaborative participant in an agent network with long-term memory—enabling it to store spatial analysis insights onchain, build knowledge graphs of location patterns over time, and share geospatial intelligence with other agents in the ecosystem. This integration unlocks powerful capabilities like persistent session context, cross-agent location verification services, and the ability to contribute to community-driven location intelligence, positioning your agent as both a consumer and provider of valuable spatial data within a growing network of AI agents that can learn from and build upon each other's discoveries.
Once the Astral MCP agent is functional, we plan to integrate it with the Recall platform to enable persistent memory by storing insights onchain. You can find out more details on this next stage of development in the following section.
Quick Start
Prerequisites
- Python 3.12+ (tested with Python 3.13)
- Poetry for dependency management
Installation
- Clone the repository:
git clone <repository-url>
cd astral-api-mcp
- Install dependencies using Poetry:
poetry install
- Verify the installation:
poetry run python -c "import astral_mcp_server; print('Installation successful!')"
- Test API connectivity:
poetry run python -c "import asyncio; from astral_mcp_server.server import check_astral_api_health; print('Health check:', asyncio.run(check_astral_api_health())['status'])"
Configuration
Selecting API Endpoint:
The MCP server can be configured to use either the production or development Astral API endpoint:
-
Via Environment Variable (highest priority):
export ASTRAL_USE_DEV_ENDPOINT=true poetry run start-server
-
Via MCP Configuration (
.vscode/mcp.json):{ "servers": { "astral-api": { "command": "poetry", "args": ["run", "start-server"], "cwd": "${workspaceFolder}", "type": "stdio" } }, "mcp_agent": { "use_dev_endpoint": true, "dev_endpoint": "https://custom-dev-api.example.com" } }
Configuration Options:
use_dev_endpoint: Set totrueto use the development API endpointdev_endpoint(optional): Override the default dev endpoint URL with a custom one
The server will automatically select the appropriate endpoint on startup and log which endpoint is being used.
Available Agent Tools
check_astral_api_health: Verify connectivity to the Astral APIget_server_info: Get information about the MCP server instancequery_location_proofs: Query location proofs by various filters (chain, prover, schema ID, etc.)get_location_proof_by_uid: Retrieve a specific location proof attestation by its unique identifierget_astral_config: Fetch the Astral API configuration and supported chains
Learn more about the available tools and how to use them in the MCP Tools Guide.
Testing the MCP Server
Important: MCP servers don't run as web servers - they communicate via the MCP protocol.
Test with MCP Inspector (interactive debugging):
poetry run mcp dev astral_mcp_server/server.py
Alternatively, you can start the MCP Inspector from mcp.json via the UI in VSCode.
This will open the MCP Inspector tool in your browser where you can:
- See available tools (
check_astral_api_health,get_server_info) - Execute tools interactively
- View tool outputs and debug
The .env-mcp-inspector file sets environment variables that the MCP Inspector uses to connect to the MCP server. You can modify it if needed.
Use with Claude Desktop or other MCP clients:
The following configurations allow you to connect the MCP server with clients like Claude Desktop or VSCode MCP extension.
Claude Desktop's config:
{
"mcpServers": {
"astral-api": {
"command": "poetry",
"args": ["run", "start-server"],
"cwd": "/path/to/astral-api-mcp" // the local path to cloned astral-api-mcp repo
}
}
}
VSCode MCP extension's config:
{
"servers": {
"astral-api": {
"command": "poetry",
"args": ["run", "start-server"],
"cwd": "${workspaceFolder}" // or the local path to cloned astral-api-mcp repo
}
}
}
Once configured, you can connect to the MCP server from your client (i.e. GitHub Copilot Chat in agent mode) and start using the available tools.
Testing
Run the test suite:
poetry run pytest tests/ -v
Development
This project uses:
- Poetry for dependency management
- FastMCP framework for MCP server implementation
- httpx for HTTP requests to Astral API
- pytest for testing
Troubleshooting
If you encounter any PORT IS IN USE errors while running the MCP Inspector such as this:
[warning] [server stderr] ❌ MCP Inspector PORT IS IN USE at http://localhost:8881 ❌
The MCP Inspector may already be running in another terminal or process or the port is occupied by another service that will need to be stopped. If the MCP Inspector is not running, it may have not exited cleanly, leaving an orphaned process i.e. node.exe still holding the port. If that's the case, you can try running the free-mcp-ports scripts found here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astral_mcp_server-0.1.1.tar.gz.
File metadata
- Download URL: astral_mcp_server-0.1.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.12.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e91d01f9ca8fd9eff5b822e8f783c1883fb2696df5dcfe09d97b92f276cfbc25
|
|
| MD5 |
acf5cac86c47d6d3852211ed550ac801
|
|
| BLAKE2b-256 |
13de6ef2b6589df7e4e35026180bd414655ecb40881ae8d4b5bba13e1855d4d7
|
File details
Details for the file astral_mcp_server-0.1.1-py3-none-any.whl.
File metadata
- Download URL: astral_mcp_server-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.12.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbd0ca53210c428c72d7c25c175078cc0d225cdda1ed36db28b7acade590de91
|
|
| MD5 |
0034100cbf96c2c064f61f68ab89d5d6
|
|
| BLAKE2b-256 |
470e5b39009e3de8476038f89f0e1b43ed59a08d53ae2fef409c5f209e2901fc
|