Open Targets Platform Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Open Targets Platform Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
⚠️ DISCLAIMER: This project is currently experimental and under active development. Features, APIs, and documentation may change without notice ⚠️
Model Context Protocol (MCP) server for the [Open Targets Platform API](https://platform.opentargets.org/)
This package is the official Open Targets Platform MCP server implementation that enables AI assistants to interact with the Open Targets Platform GraphQL API, a comprehensive resource for target-disease associations and drug discovery data.
The easiest way to use Open Targets Platform MCP is through the hosted service provided by Open Targets infrastructure at https://mcp.platform.opentargets.org/mcp
The fastest way to get started is using uvx, which will automatically download and run the package directly from GitHub.
Examples:
# Start HTTP server bound to localhost:8000 (default)
uvx --from git+https://github.com/opentargets/open-targets-platform-mcp otp-mcp
# Get help
uvx --from git+https://github.com/opentargets/open-targets-platform-mcp otp-mcp --help
# With jq filtering enabled
uvx --from git+https://github.com/opentargets/open-targets-platform-mcp otp-mcp --jqYou can run the MCP server using the official Docker image:
# Pull the latest image
docker pull ghcr.io/opentargets/open-targets-platform-mcp
# Run as a daemon with HTTP transport
docker run -d \
-p 8000:8000 \
-e OTP_MCP_HTTP_HOST=0.0.0.0 \
ghcr.io/opentargets/open-targets-platform-mcp
# Run as a daemon with jq filtering enabled
docker run -d \
-p 8000:8000 \
-e OTP_MCP_HTTP_HOST=0.0.0.0 \
-e OTP_MCP_JQ_ENABLED=true \
ghcr.io/opentargets/open-targets-platform-mcpFor available CLI arguments and environment variables, see the Server Settings table.
Both advanced deployment options require cloning the repository and setting up the virtual environment first:
# Clone the repository
git clone https://github.com/opentargets/open-targets-platform-mcp.git
cd open-targets-platform-mcp
# Install dependencies
uv sync --python 3.10For advanced usage and to utilize all FastMCP options, you can use the FastMCP CLI directly with the server module:
# Run using FastMCP CLI
uv run fastmcp run ./src/open_targets_platform_mcp/server.pyNote: For all FastMCP CLI options, see the FastMCP documentation. Note: Use environment variables (see Server Settings table) to configure the server when using FastMCP CLI.
For development or to modify the codebase:
# Run the server
uv run otp-mcp
# Get help
uv run otp-mcp --helpThe package provides two command variants:
otp-mcp: Shorter alias (recommended)open-targets-platform-mcp: Full command nameBoth commands are functionally identical.
Configure the server using environment variables (all prefixed with OTP_MCP_). The following table shows all available configuration options:
| Environment Variable | CLI Option | Description | Default |
|---|---|---|---|
OTP_MCP_API_ENDPOINT | --api | Open Targets Platform API endpoint URL | https://api.platform.opentargets.org/api/v4/graphql |
OTP_MCP_SERVER_NAME | --name | Server name displayed in MCP | "Model Context Protocol server for Open Targets Platform" |
OTP_MCP_TRANSPORT | --transport | Transport type: stdio or http | http |
OTP_MCP_HTTP_HOST | --host | HTTP server host (only used with http transport) | localhost |
OTP_MCP_HTTP_PORT | --port | HTTP server port (only used with http transport) | 8000 |
OTP_MCP_STATELESS_HTTP | --stateless-http | Enable stateless HTTP mode (only used with http transport) | true |
OTP_MCP_API_CALL_TIMEOUT | --timeout | Request timeout in seconds for API calls | 30 |
OTP_MCP_JQ_ENABLED | --jq | Enable jq filtering support | false |
OTP_MCP_RATE_LIMITING_ENABLED | --rate-limiting | Enable rate limiting | false |
OTP_MCP_RATE_LIMITING_MAX_REQUESTS_PER_SECOND | _(env only)_ | Maximum requests per second when rate limiting is enabled | 3 |
OTP_MCP_RATE_LIMITING_BURST_CAPACITY | _(env only)_ | Maximum burst capacity when rate limiting is enabled | 100 |
OTP_MCP_DETAILED_TIMING_ENABLED | --detailed-timing | Enable logging of detailed timing information for requests | false |
Examples:
Using environment variables:
export OTP_MCP_TRANSPORT=stdio
export OTP_MCP_JQ_ENABLED=true
otp-mcpUsing CLI options:
otp-mcp --transport stdio --jqNote: CLI options take precedence over environment variables when both are provided.
The MCP server provides the following tools:
The MCP server implements a 3-step workflow that guides the LLM to efficiently retrieve data from the Open Targets Platform:
The LLM calls get_open_targets_graphql_schema with specific categories (e.g., "targets", "drug-mechanisms") to retrieve a focused subset of the schema. This provides detailed documentation for relevant types and fields, enabling the LLM to construct valid queries without being overwhelmed by the entire schema. The schema also includes specific guidance on how to properly declare GraphQL variables to avoid variable resolution errors.
If deeper or more specific schema exploration is needed, the LLM can fall back to the get_type_dependencies tool to fetch the exact dependency tree and SDL subset for one or more specific types.
Key entity types include:
ENSG00000139618 for BRCA2)MONDO_0007254 for breast cancer)CHEMBL1201583 for aspirin)When a user query contains common names (gene symbols, disease names, drug names), the LLM uses search_entities to convert them to standardized IDs required by the API.
The LLM constructs and executes GraphQL queries using:
Tool selection:
query_open_targets_graphql for single queriesbatch_query_open_targets_graphql for multiple identical queries with different parameters (reduces latency and tokens)The MCP server supports optional server-side JSON processing using jq expressions. This feature is disabled by default but can be enabled if you want to reduce token consumption.
#### Enable jq Filtering When:
#### Disable jq Filtering When:
#### How jq Filtering Works
When jq filtering is enabled, the query tools expose a jq_filter parameter. The jq filter is applied server-side before the response is returned, extracting only the relevant data and discarding unnecessary fields.
Example: To extract only the gene symbol and ID from a target query:
jq_filter: ".data.target | {id, symbol: .approvedSymbol}"This significantly reduces token consumption by returning only the requested fields instead of the full API response.
For detailed instructions on configuring the Open Targets Platform MCP server with Claude Desktop, including both remote hosted service and local installation configurations, see CLAUDE_DESKTOP.md.
The test suite is built around two guiding principles:
1. Test at the highest meaningful level. Tests exercise the server through the fastmcp in-process client (Client.call_tool()), the same interface an LLM uses at runtime. This makes every test a near-system test: tool registration, argument validation, description generation, and response serialisation are all covered as a single end-to-end path, rather than testing internal functions in isolation.
2. Use GraphQL replay instead of live network calls. Real API responses are recorded once into a cassette file (test/fixtures/generated/graphql_cassette.json) by running the generator script against the live API. During normal test runs the cassette is replayed deterministically, so tests are fast, reproducible, and do not depend on network availability. The cassette is regenerated intentionally when new queries are needed:
uv run python test/fixtures/generated/generate_fixtures.pyTo run tests against the live API instead of the cassette:
uv run python -m pytest --liveContributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the terms of the license specified in LICENSE.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.