GW_MCP
About
An MCP (Model Context Protocol) server providing tools to query Gravitational Wave (GW) data from GraceDB and GWOSC.
Details
- Author
- adamzacharia
- Categories
- Search, Developer Tools, Other, Knowledge Base
Jump to
Setup
Install GW_MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/adamzacharia/GW_MCP
Follow the installation instructions in the repository README, then restart your MCP client.
An MCP (Model Context Protocol) server providing tools to query Gravitational Wave (GW) data from GraceDB and GWOSC.
MCP (Model Context Protocol) allows AI assistants like Claude to use external tools. This server gives Claude the ability to query gravitational wave databases in real-time, so you can ask questions about GW events in natural language.
Once connected, you can ask Claude questions like:
- "What was the GPS time of GW150914?"
- "Show me all events in the GWTC-3 catalog"
- "Get strain data from the Hanford detector around GW150914"
- "Search for gravitational wave events with FAR less than 1e-10"
- "What files are available for a specific GraceDB event?"
This server works out-of-the-box with public data only.
# Create new conda environment with Python 3.11 conda create -n opticsGPT python=3.11 -y # Activate the environment conda activate opticsGPT
cd C:\Users\Asus\Desktop\OpticsGPT\GW_MCP # Install from requirements.txt pip install -r requirements.txt
# Test GWOSC (should print GPS time) python -c "from gwosc.datasets import event_gps; print('GW150914 GPS:', event_gps('GW150914'))"
{ "mcpServers": { "GW-Data": { "command": "C:/Users/Asus/anaconda3/envs/mcp/python.exe", "args": ["C:/Users/Asus/Desktop/GW_MCP/server.py"] } } }
WARNING: You must update the paths below to match your system. Change:
- The Python executable path to your conda environment location
- The server.py path to where you cloned this repository
Find your Python path with:conda activate mcp && where python
You can use this MCP server with LangChain using thelangchain-mcp-adapterspackage:
from langchain_mcp_adapters.client import MCPClient from langchain_openai import ChatOpenAI # Connect to the MCP server client = MCPClient( command="python", args=["path/to/GW_MCP/server.py"] ) # Get tools from MCP server tools = client.get_tools() # Use with any LangChain-compatible LLM llm = ChatOpenAI(model="gpt-4") llm_with_tools = llm.bind_tools(tools)
For open source LLMs (Ollama, LMStudio, etc.), you can:
- Use MCP-compatible clients: Some open source projects likeMCP CLIsupport connecting MCP servers to local LLMs.
- Direct function calling: Import the service classes directly in your Python code:
from services.gracedb_service import get_gracedb_service from services.gwosc_service import get_gwosc_service # Use services directly gwosc = get_gwosc_service() gps_time = gwosc.get_event_gps("GW150914") print(f"GPS time: {gps_time}")
- Build a REST API: Wrap the services in a FastAPI/Flask server for any LLM that supports function calling via HTTP.
If you have LIGO credentials, you can access real-time alerts from the current observing run.
By default, theligo-gracedbclient searches for credentials in this order:
- SciTokenat/tmp/bt_u${UID}orSCITOKEN_FILEenvironment variable
- X.509 credentialsfrom thecredparameter (cert/key pair or proxy file)
- Environment variables:X509_USER_CERT+X509_USER_KEY
- Environment variable:X509_USER_PROXY
- Proxy from ligo-proxy-init:/tmp/x509up_u${UID}
- Default location:~/.globus/usercert.pemand~/.globus/userkey.pem
- No credentials(public access only)
Set these before running the MCP server:
# For SciToken export SCITOKEN_FILE=/path/to/your/scitoken # OR for X.509 certificate export X509_USER_CERT=/path/to/usercert.pem export X509_USER_KEY=/path/to/userkey.pem # OR for proxy file export X509_USER_PROXY=/tmp/x509up_u${UID}
Editsrc/gw_mcp_server/services/gracedb_service.py:
# For X.509 cert/key pair: self._client = GraceDb( cred=('/path/to/cert.pem', '/path/to/key.pem') ) # For combined proxy file: self._client = GraceDb( cred='/path/to/proxy.pem' ) # To explicitly use only SciToken: self._client = GraceDb(use_auth='scitoken') # To explicitly use only X.509: self._client = GraceDb(use_auth='x509')
If you want to explicitly disable authentication attempts:
self._client = GraceDb(force_noauth=True)
- ligo-proxy-init: Runligo-proxy-initto create a short-lived proxy from your certificate
- htgettoken: Usehtgettokento obtain a SciToken
- CILogon: Get certificates fromhttps://cilogon.org
from ligo.gracedb.rest import GraceDb client = GraceDb() client.show_credentials() # Prints auth type and info # Test access to current run superevents try: for se in client.superevents('category: Production', max_results=5): print(se['superevent_id']) except Exception as e: print(f"Auth required: {e}")
GraceDb( service_url='https://gracedb.ligo.org/api/', # Production server # service_url='https://gracedb-playground.ligo.org/api/', # Test server cred=None, # Path to credentials force_noauth=False, # Skip credential lookup fail_if_noauth=False, # Fail if no credentials found reload_cred=False, # Auto-reload expiring credentials reload_buffer=300, # Seconds before expiry to reload use_auth='all', # 'all', 'scitoken', or 'x509' retries=5, # Max retries on server error )
For full documentation:https://ligo-gracedb.readthedocs.io/en/latest/
If you use this software in your research, please cite:
@software{gw_mcp, title={GW MCP Server: Gravitational Wave Data Access for AI Agents}, ={Adam Zacharia Anil}, year={2025}, url={https://github.com/adamzacharia/GW_MCP} }
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
searchcode.com — Code Intelligence for LLMs
Structured access to code analysis, search, and retrieval for any public git repository—purpose-built for large language models.
Interact with the GitHub API for file operations, repository management, and search.
An MCP server that makes documentation and codebases searchable for AI assistants, supporting local directories and Git repositories.
Anchor is local repo and org memory for AI coding agents. It indexes GitHub PR history, current code, tests, regressions, architecture, and cross-repo impact locally, then exposes concise cited context through MCP and CLI workflows. Local-first. Read-only GitHub access. No CLI telemetry. No SaaS. No remote LLM calls.
Search Spryker packages, documentation, and code within Spryker GitHub repositories using natural language.
Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.
Semantic code search for AI agents without indexing your codebase or storing any data. Fast and accurate.
Create and read feature flags, review experiments, generate flag types, search docs, and interact with GrowthBook's feature flagging and experimentation platform.
Word search, crossword, and sudoku generator MCP server with printable PDF worksheets, themed word banks, and verifiable LLM evals. Local-first, from the makers of puzzletide.com.
Official MCP server for Stimulsoft Reports & Dashboards documentation. Semantic search across FAQ, Programming Manual, Server/User Manual, and Server/Cloud API for .NET, WPF, Avalonia, WEB, Blazor, Angular, React, JS, PHP, Java, and Python platforms.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




