Spaces:
Running
Running
File size: 4,300 Bytes
026ee5d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# MCP Integration
DeepCritical exposes a Model Context Protocol (MCP) server, allowing you to use its search tools directly from Claude Desktop or other MCP clients.
## What is MCP?
The Model Context Protocol (MCP) is a standard for connecting AI assistants to external tools and data sources. DeepCritical implements an MCP server that exposes its search capabilities as MCP tools.
## MCP Server URL
When running locally:
```
http://localhost:7860/gradio_api/mcp/
```
## Claude Desktop Configuration
### 1. Locate Configuration File
**macOS**:
```
~/Library/Application Support/Claude/claude_desktop_config.json
```
**Windows**:
```
%APPDATA%\Claude\claude_desktop_config.json
```
**Linux**:
```
~/.config/Claude/claude_desktop_config.json
```
### 2. Add DeepCritical Server
Edit `claude_desktop_config.json` and add:
```json
{
"mcpServers": {
"deepcritical": {
"url": "http://localhost:7860/gradio_api/mcp/"
}
}
}
```
### 3. Restart Claude Desktop
Close and restart Claude Desktop for changes to take effect.
### 4. Verify Connection
In Claude Desktop, you should see DeepCritical tools available:
- `search_pubmed`
- `search_clinical_trials`
- `search_biorxiv`
- `search_all`
- `analyze_hypothesis`
## Available Tools
### search_pubmed
Search peer-reviewed biomedical literature from PubMed.
**Parameters**:
- `query` (string): Search query
- `max_results` (integer, optional): Maximum number of results (default: 10)
**Example**:
```
Search PubMed for "metformin diabetes"
```
### search_clinical_trials
Search ClinicalTrials.gov for interventional studies.
**Parameters**:
- `query` (string): Search query
- `max_results` (integer, optional): Maximum number of results (default: 10)
**Example**:
```
Search clinical trials for "Alzheimer's disease treatment"
```
### search_biorxiv
Search bioRxiv/medRxiv preprints via Europe PMC.
**Parameters**:
- `query` (string): Search query
- `max_results` (integer, optional): Maximum number of results (default: 10)
**Example**:
```
Search bioRxiv for "CRISPR gene editing"
```
### search_all
Search all sources simultaneously (PubMed, ClinicalTrials.gov, Europe PMC).
**Parameters**:
- `query` (string): Search query
- `max_results` (integer, optional): Maximum number of results per source (default: 10)
**Example**:
```
Search all sources for "COVID-19 vaccine efficacy"
```
### analyze_hypothesis
Perform secure statistical analysis using Modal sandboxes.
**Parameters**:
- `hypothesis` (string): Hypothesis to analyze
- `data` (string, optional): Data description or code
**Example**:
```
Analyze the hypothesis that metformin reduces cancer risk
```
## Using Tools in Claude Desktop
Once configured, you can ask Claude to use DeepCritical tools:
```
Use DeepCritical to search PubMed for recent papers on Alzheimer's disease treatments.
```
Claude will automatically:
1. Call the appropriate DeepCritical tool
2. Retrieve results
3. Use the results in its response
## Troubleshooting
### Connection Issues
**Server Not Found**:
- Ensure DeepCritical is running (`uv run gradio run src/app.py`)
- Verify the URL in `claude_desktop_config.json` is correct
- Check that port 7860 is not blocked by firewall
**Tools Not Appearing**:
- Restart Claude Desktop after configuration changes
- Check Claude Desktop logs for errors
- Verify MCP server is accessible at the configured URL
### Authentication
If DeepCritical requires authentication:
- Configure API keys in DeepCritical settings
- Use HuggingFace OAuth login
- Ensure API keys are valid
## Advanced Configuration
### Custom Port
If running on a different port, update the URL:
```json
{
"mcpServers": {
"deepcritical": {
"url": "http://localhost:8080/gradio_api/mcp/"
}
}
}
```
### Multiple Instances
You can configure multiple DeepCritical instances:
```json
{
"mcpServers": {
"deepcritical-local": {
"url": "http://localhost:7860/gradio_api/mcp/"
},
"deepcritical-remote": {
"url": "https://your-server.com/gradio_api/mcp/"
}
}
}
```
## Next Steps
- Learn about [Configuration](../configuration/index.md) for advanced settings
- Explore [Examples](examples.md) for use cases
- Read the [Architecture Documentation](../architecture/graph-orchestration.md)
|