Add your description here
Project description
TRAPI MCP
A FastMCP-based tool for writing prompts using Translator Reasoner API (TRAPI) queries. This package enables easy integration of biomedical knowledge graph queries into your LLM workflows.
Installation
You can install the package from source:
pip install -e .
Or using uv (recommended):
uv install trapi-mcp
Python API
from trapi_mcp.tools import trapi, trapi_status, trapi_results
# Submit a TRAPI query
response = trapi(
subject="MONDO:0005148", # Alzheimer's disease
object_="CHEBI:6801", # Acetylcholine
predicate="biolink:affects"
)
# Get the query ID
pk = response["pk"]
# Check status
status_response = trapi_status(pk)
print(f"Query status: {status_response.get('status')}")
# When status is "Done", get results
if status_response.get("status") == "Done":
results = trapi_results(pk)
# Process results
Developer Guide
Setup Development Environment
- Clone the repository:
git clone https://github.com/your-username/trapi-mcp.git
cd trapi-mcp
- Install development dependencies:
uv install
Architecture
The package consists of several key components:
api_utilities.py: Low-level functions for interacting with Translator API services - e.g., how to make API callstools.py: High-level functions for building and executing TRAPI queries. Currently, NameResolver, NodeNormalizer, and ARS query endpoints are all callable as MCP servers from this repository.main.py: FastMCP integration and CLI setup
Integration with Goose (Example)
Goose is a framework for building LLM applications. Here's how to integrate TRAPI MCP with Goose:
install goose:
https://block.github.io/goose/docs/getting-started/installation/
Set an LLM Provider
https://block.github.io/goose/docs/getting-started/installation/#set-llm-provider
Add TRAPI MCP as an extenstion
https://block.github.io/goose/docs/getting-started/using-extensions#adding-extensions
- Under "Advanced Settings"
- "Add custom extension"
- Name the extension "TRAPI MCP"
- For "Command", add "uvx trapi-mcp"
- "Save Changes"
- Turn "on" the extension for your session.
- Ask questions of goose like:
-
What is the relationship between Alzheimer's disease and acetylcholine?
-
How many disesaes is ABCA1 related to?
-
What treats diabetes mellitus?
Project details
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 trapi_mcp-0.1.3.tar.gz.
File metadata
- Download URL: trapi_mcp-0.1.3.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dce2d6256bbc93fbcfc1080b3ddfc2836bb42713d29baad96e292eb97088fa8
|
|
| MD5 |
ea5b7abefe4f353154c9682430620b8a
|
|
| BLAKE2b-256 |
04cffb2436c8fee14215e8007f7a01cbd10052b5d9566de1730e0eadabd8f984
|
Provenance
The following attestation bundles were made for trapi_mcp-0.1.3.tar.gz:
Publisher:
pypi-publish.yaml on sierra-moxon/trapi-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trapi_mcp-0.1.3.tar.gz -
Subject digest:
5dce2d6256bbc93fbcfc1080b3ddfc2836bb42713d29baad96e292eb97088fa8 - Sigstore transparency entry: 240187903
- Sigstore integration time:
-
Permalink:
sierra-moxon/trapi-mcp@16da9bcb4d01ec4ce4f5a80625a450b8c5ee8e4d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/sierra-moxon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@16da9bcb4d01ec4ce4f5a80625a450b8c5ee8e4d -
Trigger Event:
release
-
Statement type:
File details
Details for the file trapi_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: trapi_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
471fe4a94bbd645dee1a464d9591eee8306e6182a5a0eb4977f170e76ed89e12
|
|
| MD5 |
1b31e84ac5a17e5cedf8454960bf0ed3
|
|
| BLAKE2b-256 |
038e7d77984d3d0c3006b4dcc9d98391fee81a9afc242a2f02701f533e69555f
|
Provenance
The following attestation bundles were made for trapi_mcp-0.1.3-py3-none-any.whl:
Publisher:
pypi-publish.yaml on sierra-moxon/trapi-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trapi_mcp-0.1.3-py3-none-any.whl -
Subject digest:
471fe4a94bbd645dee1a464d9591eee8306e6182a5a0eb4977f170e76ed89e12 - Sigstore transparency entry: 240187911
- Sigstore integration time:
-
Permalink:
sierra-moxon/trapi-mcp@16da9bcb4d01ec4ce4f5a80625a450b8c5ee8e4d -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/sierra-moxon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@16da9bcb4d01ec4ce4f5a80625a450b8c5ee8e4d -
Trigger Event:
release
-
Statement type: