A Model Context Protocol (MCP) server for accessing VAMDC (Virtual Atomic and Molecular Data Centre) spectroscopic databases.
MCP server providing access to VAMDC spectroscopic databases through the Model Context Protocol. Built on pyVAMDC for querying atomic and molecular data from distributed databases worldwide.
-
5 MCP Tools for querying spectroscopic data:
get_server_info- Server capabilities and metadataget_nodes- List all available VAMDC database nodes (33 databases)get_species- Get chemical species data (4,952+ species)get_species_by_node- Filter species by specific database nodeget_lines- Query spectral lines within wavelength range
-
Dual Transport Support:
- HTTP (Streamable HTTP) - For web/remote access
- stdio - For desktop MCP clients (Claude Desktop, IDEs)
-
Clean Architecture: Module-level tool registration, async execution with thread pools
- Python 3.13+
- uv package manager
Clone the repository:
git clone https://github.com/VAMDC/vamdc-mcp.git
cd vamdc-mcpNo additional installation needed - uv will handle dependencies automatically.
Start the server with HTTP transport for web/remote access:
uv run server.py --transport http --port 8888The server will be available at http://localhost:8888/mcp
Change port (optional):
uv run server.py --transport http --port 9000Start the server with stdio transport for desktop MCP clients:
uv run server.py --transport stdioThis mode is used by desktop applications like Claude Desktop, VSCode extensions, etc.
uv run server.py --helpOptions:
--transport {http,stdio}- Transport protocol (default:http)--port PORT- Port for HTTP transport (default:8888)
Using curl to interact with the HTTP server:
# 1. Initialize the session
curl -X POST "http://localhost:8888/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"initialize",
"params":{
"protocolVersion":"2025-03-26",
"capabilities":{},
"clientInfo":{"name":"test-client","version":"1.0.0"}
}
}'
# 2. List available tools
curl -X POST "http://localhost:8888/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# 3. Get database nodes
curl -X POST "http://localhost:8888/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc":"2.0",
"id":3,
"method":"tools/call",
"params":{"name":"get_nodes","arguments":{}}
}'
# 4. Get species from specific node (AMDIS Ionization)
curl -X POST "http://localhost:8888/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc":"2.0",
"id":4,
"method":"tools/call",
"params":{
"name":"get_species_by_node",
"arguments":{"node_url":"http://dbshino.nifs.ac.jp:4000/vamdc/tap/"}
}
}'
# 5. Query spectral lines (1000-1500 Angstrom, Magnesium from VALD)
curl -X POST "http://localhost:8888/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc":"2.0",
"id":5,
"method":"tools/call",
"params":{
"name":"get_lines",
"arguments":{
"lambda_min":1000.0,
"lambda_max":1500.0,
"listNodes":["http://vald.astro.uu.se/atoms-12.07/tap/"],
"listSpecies":["FYYHWMGAXLPEAU-UHFFFAOYSA-N"]
}
}
}'Using echo/pipe for stdio communication:
# Send initialize request
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | uv run server.py --transport stdio
# Interactive session with multiple requests
cat <<'EOF' | uv run server.py --transport stdio
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/list"}
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_server_info","arguments":{}}}
EOFTo use with Claude Desktop, add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"vamdc": {
"command": "bash",
"args": ["/path/to/vamdc-mcp/start_server.sh"]
}
}
}{
"mcpServers": {
"vamdc": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/vamdc-mcp",
"server.py",
"--transport",
"stdio"
]
}
}
}Replace /path/to/vamdc-mcp with the actual path to your cloned repository.
Note: The start_server.sh script is included for convenience and handles directory navigation automatically.
Adding the local MCP to Codex just takes this command, run from within the base directory of this repository:
codex mcp add vamdc -- uv run server.py --transport stdioAfter that, the tools are available in Codex sessions.
Get server metadata and capabilities.
Parameters: None
Returns: Server name, version, available tools list
List all VAMDC database nodes.
Parameters: None
Returns: 33 database nodes with metadata (name, TAP endpoint, topics, contact info)
Get all chemical species data.
Parameters:
state(string): State filter (currently not implemented, accepts any value)
Returns: 4,952+ species with InChI, InChIKey, formulas, charges, masses
Filter species by specific database node.
Parameters:
node_url(string): TAP endpoint URL of the database node- Example:
"http://vald.astro.uu.se/atoms-12.07/tap/"
- Example:
Returns: Filtered species list from specified node
Query spectral lines within wavelength range.
Parameters:
lambda_min(float): Lower wavelength bound in Angstrom (required)lambda_max(float): Upper wavelength bound in Angstrom (required)listNodes(array of strings, optional): Filter by TAP endpoint URLslistSpecies(array of strings, optional): Filter by InChIKeys
Returns: Spectral line data including frequencies, Einstein coefficients, energy levels, quantum numbers
Note: This tool queries remote VAMDC databases, which may be slow or timeout depending on the wavelength range and filters.
- FastMCP Framework: Built on the official MCP Python implementation
- Async Execution: Thread pool execution for blocking database operations
- Stateless HTTP: No session state maintained between requests
- Module-level Tools: Clean, flat structure for easy maintenance
Managed automatically by uv:
mcp- Model Context Protocol implementationuvicorn- ASGI server for HTTP transportpyVAMDC- Python interface to VAMDC databases (GitHub)- Handles queries to remote VAMDC TAP endpoints
- Processes spectroscopic data from multiple databases
- Provides filtering and data manipulation utilities
See mcp_server_test_log.md for comprehensive testing documentation.
Implements MCP protocol version 2025-03-26
See repository for license information.
Contributions welcome! Please open an issue or pull request on GitHub.