Skip to content

Commit ed1886b

Browse files
committed
renamed mcp vars to fit best practices
1 parent 9e9a222 commit ed1886b

File tree

11 files changed

+151
-152
lines changed

11 files changed

+151
-152
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ async def mcp_research_example():
149149
query="What are the top open source web research agents?",
150150
mcp_configs=[
151151
{
152-
"server_name": "github",
153-
"server_command": "npx",
154-
"server_args": ["-y", "@modelcontextprotocol/server-github"],
152+
"name": "github",
153+
"command": "npx",
154+
"args": ["-y", "@modelcontextprotocol/server-github"],
155155
"env": {"GITHUB_TOKEN": os.getenv("GITHUB_TOKEN")}
156156
}
157157
]

docs/docs/gpt-researcher/retrievers/mcp-configs.mdx

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ researcher = GPTResearcher(
6969
query="How does React's useState hook work?",
7070
mcp_configs=[
7171
{
72-
"server_command": "npx",
73-
"server_args": ["-y", "@modelcontextprotocol/server-github"],
72+
"name": "github_api"
73+
"command": "npx",
74+
"args": ["-y", "@modelcontextprotocol/server-github"],
7475
"env": {"GITHUB_TOKEN": os.getenv("GITHUB_TOKEN")}
7576
}
7677
]
@@ -86,15 +87,15 @@ Each MCP configuration dictionary supports these keys:
8687

8788
| Key | Description | Example | Required |
8889
|-----|-------------|---------|----------|
89-
| `server_name` | Identifier for the MCP server | `"github"` | No |
90-
| `server_command` | Command to start the server | `"python"` | Yes* |
91-
| `server_args` | Arguments for the server command | `["-m", "my_server"]` | No |
90+
| `name` | Identifier for the MCP server | `"github"` | No |
91+
| `command` | Command to start the server | `"python"` | Yes* |
92+
| `args` | Arguments for the server command | `["-m", "my_server"]` | No |
9293
| `env` | Environment variables for the server | `{"API_KEY": "key"}` | No |
9394
| `connection_url` | URL for remote connections | `"wss://api.example.com"` | Yes* |
9495
| `connection_type` | Connection type (auto-detected) | `"websocket"` | No |
9596
| `connection_token` | Authentication token | `"bearer_token"` | No |
9697

97-
*Either `server_command` (for local servers) or `connection_url` (for remote servers) is required.
98+
*Either `command` (for local servers) or `connection_url` (for remote servers) is required.
9899

99100
## Examples
100101

@@ -113,9 +114,9 @@ researcher = GPTResearcher(
113114
query="What are the latest updates in the NBA playoffs?",
114115
mcp_configs=[
115116
{
116-
"server_name": "tavily",
117-
"server_command": "npx",
118-
"server_args": ["-y", "[email protected]"],
117+
"name": "tavily",
118+
"command": "npx",
119+
"args": ["-y", "[email protected]"],
119120
"env": {
120121
"TAVILY_API_KEY": os.getenv("TAVILY_API_KEY")
121122
}
@@ -139,9 +140,9 @@ researcher = GPTResearcher(
139140
query="What are the key features and implementation of React's useState hook? How has it evolved in recent versions?",
140141
mcp_configs=[
141142
{
142-
"server_name": "github",
143-
"server_command": "npx",
144-
"server_args": ["-y", "@modelcontextprotocol/server-github"],
143+
"name": "github",
144+
"command": "npx",
145+
"args": ["-y", "@modelcontextprotocol/server-github"],
145146
"env": {
146147
"GITHUB_PERSONAL_ACCESS_TOKEN": os.getenv("GITHUB_PERSONAL_ACCESS_TOKEN")
147148
}
@@ -162,9 +163,9 @@ researcher = GPTResearcher(
162163
query="Analyze the latest developments in quantum error correction algorithms",
163164
mcp_configs=[
164165
{
165-
"server_name": "quantum_research",
166-
"server_command": "python",
167-
"server_args": ["quantum_mcp_server.py"],
166+
"name": "quantum_research",
167+
"command": "python",
168+
"args": ["quantum_mcp_server.py"],
168169
"env": {
169170
"ARXIV_API_KEY": os.getenv("ARXIV_API_KEY"),
170171
"RESEARCH_DB_PATH": "/path/to/quantum_papers.db"
@@ -191,37 +192,37 @@ researcher = GPTResearcher(
191192
mcp_configs=[
192193
# Financial data and stock analysis
193194
{
194-
"server_name": "financial_data",
195-
"server_command": "python",
196-
"server_args": ["financial_mcp_server.py"],
195+
"name": "financial_data",
196+
"command": "python",
197+
"args": ["financial_mcp_server.py"],
197198
"env": {
198199
"ALPHA_VANTAGE_KEY": os.getenv("ALPHA_VANTAGE_KEY"),
199200
"YAHOO_FINANCE_KEY": os.getenv("YAHOO_FINANCE_KEY")
200201
}
201202
},
202203
# News and market sentiment
203204
{
204-
"server_name": "news_research",
205-
"server_command": "npx",
206-
"server_args": ["-y", "[email protected]"],
205+
"name": "news_research",
206+
"command": "npx",
207+
"args": ["-y", "[email protected]"],
207208
"env": {
208209
"TAVILY_API_KEY": os.getenv("TAVILY_API_KEY")
209210
}
210211
},
211212
# Technical innovations and patents
212213
{
213-
"server_name": "github_research",
214-
"server_command": "npx",
215-
"server_args": ["-y", "@modelcontextprotocol/server-github"],
214+
"name": "github_research",
215+
"command": "npx",
216+
"args": ["-y", "@modelcontextprotocol/server-github"],
216217
"env": {
217218
"GITHUB_PERSONAL_ACCESS_TOKEN": os.getenv("GITHUB_PERSONAL_ACCESS_TOKEN")
218219
}
219220
},
220221
# Academic research and papers
221222
{
222-
"server_name": "academic_papers",
223-
"server_command": "python",
224-
"server_args": ["arxiv_mcp_server.py"],
223+
"name": "academic_papers",
224+
"command": "python",
225+
"args": ["arxiv_mcp_server.py"],
225226
"env": {
226227
"ARXIV_API_KEY": os.getenv("ARXIV_API_KEY")
227228
}
@@ -256,26 +257,26 @@ researcher = GPTResearcher(
256257
mcp_configs=[
257258
# Web trends and consumer sentiment
258259
{
259-
"server_name": "web_trends",
260-
"server_command": "npx",
261-
"server_args": ["-y", "[email protected]"],
260+
"name": "web_trends",
261+
"command": "npx",
262+
"args": ["-y", "[email protected]"],
262263
"env": {"TAVILY_API_KEY": os.getenv("TAVILY_API_KEY")}
263264
},
264265
# Social media analytics
265266
{
266-
"server_name": "social_analytics",
267-
"server_command": "python",
268-
"server_args": ["social_mcp_server.py"],
267+
"name": "social_analytics",
268+
"command": "python",
269+
"args": ["social_mcp_server.py"],
269270
"env": {
270271
"TWITTER_BEARER_TOKEN": os.getenv("TWITTER_BEARER_TOKEN"),
271272
"INSTAGRAM_ACCESS_TOKEN": os.getenv("INSTAGRAM_ACCESS_TOKEN")
272273
}
273274
},
274275
# Patent and innovation research
275276
{
276-
"server_name": "patent_research",
277-
"server_command": "python",
278-
"server_args": ["patent_mcp_server.py"],
277+
"name": "patent_research",
278+
"command": "python",
279+
"args": ["patent_mcp_server.py"],
279280
"env": {"USPTO_API_KEY": os.getenv("USPTO_API_KEY")}
280281
}
281282
]
@@ -292,7 +293,7 @@ researcher = GPTResearcher(
292293
query="Latest AI research papers on transformer architectures",
293294
mcp_configs=[
294295
{
295-
"server_name": "arxiv_api",
296+
"name": "arxiv_api",
296297
"connection_url": "wss://mcp.arxiv.org/ws", # Auto-detects WebSocket
297298
"connection_token": os.getenv("ARXIV_TOKEN"),
298299
}
@@ -315,9 +316,9 @@ researcher = GPTResearcher(
315316
# MCP will be used alongside web search automatically
316317
mcp_configs=[
317318
{
318-
"server_name": "github",
319-
"server_command": "npx",
320-
"server_args": ["-y", "@modelcontextprotocol/server-github"],
319+
"name": "github",
320+
"command": "npx",
321+
"args": ["-y", "@modelcontextprotocol/server-github"],
321322
"env": {"GITHUB_TOKEN": os.getenv("GITHUB_TOKEN")}
322323
}
323324
]
@@ -351,18 +352,18 @@ async def main():
351352
mcp_configs=[
352353
# Code repositories and technical implementations
353354
{
354-
"server_name": "github",
355-
"server_command": "npx",
356-
"server_args": ["-y", "@modelcontextprotocol/server-github"],
355+
"name": "github",
356+
"command": "npx",
357+
"args": ["-y", "@modelcontextprotocol/server-github"],
357358
"env": {
358359
"GITHUB_PERSONAL_ACCESS_TOKEN": os.getenv("GITHUB_PERSONAL_ACCESS_TOKEN")
359360
}
360361
},
361362
# Current news and industry reports
362363
{
363-
"server_name": "tavily",
364-
"server_command": "npx",
365-
"server_args": ["-y", "[email protected]"],
364+
"name": "tavily",
365+
"command": "npx",
366+
"args": ["-y", "[email protected]"],
366367
"env": {
367368
"TAVILY_API_KEY": os.getenv("TAVILY_API_KEY")
368369
}
@@ -461,8 +462,8 @@ researcher = GPTResearcher(
461462
query="your query",
462463
mcp_configs=[
463464
{
464-
"server_command": "python",
465-
"server_args": ["multi_tool_server.py"]
465+
"command": "python",
466+
"args": ["multi_tool_server.py"]
466467
# AI will choose the best tool automatically
467468
}
468469
]
@@ -481,7 +482,7 @@ GPT Researcher automatically detects connection types:
481482
{"connection_url": "https://api.example.com/mcp"}
482483

483484
# Stdio (default when no URL provided)
484-
{"server_command": "python", "server_args": ["server.py"]}
485+
{"command": "python", "args": ["server.py"]}
485486
```
486487

487488
## Troubleshooting
@@ -545,9 +546,9 @@ researcher = GPTResearcher(
545546
query="test query",
546547
mcp_configs=[
547548
{
548-
"server_name": "test",
549-
"server_command": "echo",
550-
"server_args": ["hello world"]
549+
"name": "test",
550+
"command": "echo",
551+
"args": ["hello world"]
551552
}
552553
]
553554
)

frontend/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ <h1 class="text-4xl font-extrabold mx-auto lg:text-7xl">
269269
</div>
270270
<small class="text-muted">
271271
Paste your MCP servers configuration as a JSON array. Each server should have properties like
272-
<code>server_name</code>, <code>server_command</code>, <code>server_args</code>, and optional <code>env</code> variables.
272+
<code>name</code>, <code>command</code>, <code>args</code>, and optional <code>env</code> variables.
273273
<a href="#" id="mcpExampleLink">See example →</a>
274274
</small>
275275
</div>

frontend/nextjs/components/Settings/MCPSelector.tsx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, { useState, useEffect } from 'react';
22

33
interface MCPConfig {
4-
server_name: string;
5-
server_command: string;
6-
server_args: string[];
4+
name: string;
5+
command: string;
6+
args: string[];
77
env: Record<string, string>;
88
}
99

@@ -48,11 +48,11 @@ const MCPSelector: React.FC<MCPSelectorProps> = ({
4848

4949
const errors: string[] = [];
5050
parsed.forEach((server: any, index: number) => {
51-
if (!server.server_name) {
52-
errors.push(`Server ${index + 1}: missing server_name`);
51+
if (!server.name) {
52+
errors.push(`Server ${index + 1}: missing name`);
5353
}
54-
if (!server.server_command && !server.connection_url) {
55-
errors.push(`Server ${index + 1}: missing server_command or connection_url`);
54+
if (!server.command && !server.connection_url) {
55+
errors.push(`Server ${index + 1}: missing command or connection_url`);
5656
}
5757
});
5858

@@ -118,25 +118,25 @@ const MCPSelector: React.FC<MCPSelectorProps> = ({
118118
const addPreset = (preset: string) => {
119119
const presets: Record<string, MCPConfig> = {
120120
github: {
121-
server_name: 'github',
122-
server_command: 'npx',
123-
server_args: ['-y', '@modelcontextprotocol/server-github'],
121+
name: 'github',
122+
command: 'npx',
123+
args: ['-y', '@modelcontextprotocol/server-github'],
124124
env: {
125125
GITHUB_PERSONAL_ACCESS_TOKEN: 'your_github_token_here'
126126
}
127127
},
128128
tavily: {
129-
server_name: 'tavily',
130-
server_command: 'npx',
131-
server_args: ['-y', '[email protected]'],
129+
name: 'tavily',
130+
command: 'npx',
131+
args: ['-y', '[email protected]'],
132132
env: {
133133
TAVILY_API_KEY: 'your_tavily_api_key_here'
134134
}
135135
},
136136
filesystem: {
137-
server_name: 'filesystem',
138-
server_command: 'npx',
139-
server_args: ['-y', '@modelcontextprotocol/server-filesystem', '/path/to/allowed/directory'],
137+
name: 'filesystem',
138+
command: 'npx',
139+
args: ['-y', '@modelcontextprotocol/server-filesystem', '/path/to/allowed/directory'],
140140
env: {}
141141
}
142142
};
@@ -152,7 +152,7 @@ const MCPSelector: React.FC<MCPSelectorProps> = ({
152152
currentConfig = JSON.parse(currentText);
153153
}
154154

155-
const existingIndex = currentConfig.findIndex(server => server.server_name === config.server_name);
155+
const existingIndex = currentConfig.findIndex(server => server.name === config.name);
156156

157157
if (existingIndex !== -1) {
158158
currentConfig[existingIndex] = config;
@@ -170,17 +170,17 @@ const MCPSelector: React.FC<MCPSelectorProps> = ({
170170
const showExample = () => {
171171
const exampleConfig = [
172172
{
173-
server_name: 'github',
174-
server_command: 'npx',
175-
server_args: ['-y', '@modelcontextprotocol/server-github'],
173+
name: 'github',
174+
command: 'npx',
175+
args: ['-y', '@modelcontextprotocol/server-github'],
176176
env: {
177177
GITHUB_PERSONAL_ACCESS_TOKEN: 'your_github_token_here'
178178
}
179179
},
180180
{
181-
server_name: 'filesystem',
182-
server_command: 'npx',
183-
server_args: ['-y', '@modelcontextprotocol/server-filesystem', '/path/to/allowed/directory'],
181+
name: 'filesystem',
182+
command: 'npx',
183+
args: ['-y', '@modelcontextprotocol/server-filesystem', '/path/to/allowed/directory'],
184184
env: {}
185185
}
186186
];
@@ -270,9 +270,9 @@ const MCPSelector: React.FC<MCPSelectorProps> = ({
270270
</div>
271271
<small className="text-muted" style={{ color: 'rgba(255, 255, 255, 0.6)', fontSize: '0.85rem', marginTop: '8px', display: 'block', lineHeight: '1.4' }}>
272272
Paste your MCP servers configuration as a JSON array. Each server should have properties like{' '}
273-
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>server_name</code>,{' '}
274-
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>server_command</code>,{' '}
275-
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>server_args</code>, and optional{' '}
273+
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>name</code>,{' '}
274+
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>command</code>,{' '}
275+
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>args</code>, and optional{' '}
276276
<code style={{ backgroundColor: 'rgba(255, 255, 255, 0.1)', padding: '2px 4px', borderRadius: '3px', color: '#0d9488' }}>env</code> variables.{' '}
277277
<a
278278
href="#"
@@ -319,9 +319,9 @@ const MCPSelector: React.FC<MCPSelectorProps> = ({
319319
<h4 className="highlight">Configuration Format:</h4>
320320
<p>Each MCP server should be a JSON object with these properties:</p>
321321
<ul>
322-
<li><span className="highlight">server_name:</span> Unique identifier (e.g., &quot;github&quot;, &quot;filesystem&quot;)</li>
323-
<li><span className="highlight">server_command:</span> Command to run the server (e.g., &quot;npx&quot;, &quot;python&quot;)</li>
324-
<li><span className="highlight">server_args:</span> Array of arguments (e.g., [&quot;-y&quot;, &quot;@modelcontextprotocol/server-github&quot;])</li>
322+
<li><span className="highlight">name:</span> Unique identifier (e.g., &quot;github&quot;, &quot;filesystem&quot;)</li>
323+
<li><span className="highlight">command:</span> Command to run the server (e.g., &quot;npx&quot;, &quot;python&quot;)</li>
324+
<li><span className="highlight">args:</span> Array of arguments (e.g., [&quot;-y&quot;, &quot;@modelcontextprotocol/server-github&quot;])</li>
325325
<li><span className="highlight">env:</span> Object with environment variables (e.g., {JSON.stringify({API_KEY: "your_key"})})</li>
326326
</ul>
327327
</div>

frontend/nextjs/types/data.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export interface ChatBoxSettings {
4747
}
4848

4949
export interface MCPConfig {
50-
server_name: string;
51-
server_command: string;
52-
server_args: string[];
50+
name: string;
51+
command: string;
52+
args: string[];
5353
env: Record<string, string>;
5454
}
5555

0 commit comments

Comments
 (0)