Skip to content

Commit bd5c718

Browse files
authored
Promote the usage of MCP (#1349)
* Add Synapse MCP usage * Improve documentation * Address PR comment
1 parent 7287c7b commit bd5c718

4 files changed

Lines changed: 124 additions & 1 deletion

File tree

docs/guides/synapse_mcp.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Using the Synapse MCP Server
2+
3+
The [Synapse MCP server](https://github.com/Sage-Bionetworks/synapse-mcp) implements the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) and lets AI assistants (Claude, GitHub Copilot, Cursor, and others) directly query Synapse — search for datasets, inspect entity metadata, explore project hierarchies, and trace provenance — without you writing any code.
4+
5+
The server is implemented in Python and built on top of this `synapseclient` package, so its behavior and capabilities mirror what you can do programmatically through the Python client.
6+
7+
!!! warning "Terms of Service"
8+
Using the Synapse MCP server with consumer AI services that store conversation data may violate the Synapse Terms of Service prohibition on data redistribution. Prefer enterprise deployments with data-residency guarantees or self-hosted models when working with sensitive or restricted datasets.
9+
10+
---
11+
12+
## Installation
13+
14+
### Remote server (recommended)
15+
16+
The hosted MCP server at `https://mcp.synapse.org/mcp` authenticates via OAuth2 — no token management required.
17+
18+
#### "Claude Code (CLI)"
19+
20+
```bash
21+
claude mcp add --transport http synapse -- https://mcp.synapse.org/mcp
22+
```
23+
24+
On first use, Claude Code will open a browser window to complete the OAuth2 login.
25+
26+
#### "Claude Desktop"
27+
28+
1. Open **Settings → Connectors → Add custom connector**
29+
2. Enter the URL: `https://mcp.synapse.org/mcp`
30+
3. Save and restart Claude Desktop
31+
32+
#### "VS Code / GitHub Copilot"
33+
34+
Add to your `settings.json` or `.vscode/mcp.json`:
35+
36+
```json
37+
{
38+
"mcp": {
39+
"servers": {
40+
"synapse": {
41+
"type": "http",
42+
"url": "https://mcp.synapse.org/mcp"
43+
}
44+
}
45+
}
46+
}
47+
```
48+
49+
### Local installation
50+
51+
For air-gapped environments or development, you can run the server locally using a [Personal Access Token (PAT)](https://www.synapse.org/#!PersonalAccessTokens:0).
52+
53+
```bash
54+
git clone https://github.com/Sage-Bionetworks/synapse-mcp.git
55+
cd synapse-mcp
56+
pip install -e .
57+
export SYNAPSE_PAT="your_personal_access_token"
58+
synapse-mcp
59+
```
60+
61+
Configure your MCP client to point to `http://localhost:8000/mcp` (or the port shown in the startup output).
62+
63+
---
64+
65+
## Available tools
66+
67+
For the full and up-to-date list of tools, see the [synapse-mcp repository](https://github.com/Sage-Bionetworks/synapse-mcp). At the time of writing, the server exposes tools including:
68+
69+
- `search_synapse` — full-text search across public and private entities
70+
- `get_entity` — fetch core metadata for any entity by Synapse ID
71+
- `get_entity_annotations` — retrieve custom annotation key/value pairs
72+
- `get_entity_children` — list children within a project or folder
73+
- `get_entity_provenance` — inspect the activity log and inputs/outputs for an entity version
74+
75+
---
76+
77+
## Example prompts
78+
79+
Once the MCP server is connected, you can interact with Synapse in natural language. Here are some useful prompts to try:
80+
81+
**Discover data**
82+
83+
```
84+
Search Synapse for RNA-seq datasets related to Alzheimer's Disease.
85+
```
86+
87+
```
88+
What files are in the project syn12345678?
89+
```
90+
91+
**Inspect metadata**
92+
93+
```
94+
What are the annotations on syn9876543?
95+
```
96+
97+
```
98+
Show me the provenance for the latest version of syn11223344.
99+
```
100+
101+
**Explore a project**
102+
103+
```
104+
List all folders and files in syn5678901 and summarize what the project contains.
105+
```
106+
107+
**Combine with code generation**
108+
109+
```
110+
Find the Synapse ID for the ROSMAP bulk RNA-seq dataset, then write Python code
111+
using synapseclient to download it and load it into a pandas DataFrame.
112+
```
113+
114+
---
115+
116+
## Feature requests and feedback
117+
118+
Have an idea for a new MCP tool or want to report a bug? [Open a support ticket](https://sagebionetworks.jira.com/servicedesk/customer/portal/9/group/16/create/206) via the Sage Bionetworks service desk.

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Installing this package will install `synapseclient`, `synapseutils` and the com
2828
* [Further Reading](./explanations/home.md) to gain a deeper understanding of best practices and advanced use cases
2929
* Our [release notes](./news.md)
3030

31+
## Use Synapse with AI assistants
32+
33+
The [Synapse MCP server](./guides/synapse_mcp.md) lets you query Synapse directly from AI tools like Claude, GitHub Copilot, and Cursor using natural language — search datasets, inspect metadata, explore project hierarchies, and generate `synapseclient` code, all without leaving your AI assistant. See the [how-to guide](./guides/synapse_mcp.md) to get started in minutes.
34+
3135
## Additional Background
3236

3337
* Read [about Synapse](https://help.synapse.org/docs/About-Synapse.2058846607.html)—how it got started and how it fits into the bigger data-sharing picture

docs/tutorials/python/download_data_by_synid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[](){ #tutorial-downloading-a-file }
1+
[](){ #tutorial-downloading-data-by-synapse-id }
22
# Downloading data by Synapse ID
33

44
This tutorial shows how to download any set of files from Synapse using their

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ nav:
5959
# - Using Entity Views: guides/views.md
6060
- Data Storage: guides/data_storage.md
6161
- Access the REST API: guides/accessing_the_rest_api.md
62+
- Synapse MCP Server: guides/synapse_mcp.md
6263
- Extensions:
6364
- Curator JSONschemas: guides/extensions/curator/schema_operations.md
6465
- Curator: guides/extensions/curator/metadata_curation.md

0 commit comments

Comments
 (0)