You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more details on ways to use the inspector, see the [Inspector section of the MCP docs site](https://modelcontextprotocol.io/docs/tools/inspector). For help with debugging, see the [Debugging guide](https://modelcontextprotocol.io/docs/tools/debugging).
44
44
45
+
### Configuration Export
46
+
47
+
The MCP Inspector provides convenient buttons to export your server configuration:
48
+
49
+
-**Server Entry** - Copies a single server configuration entry to your clipboard. This can be added to your `mcp.json` file inside the `mcpServers` object with your preferred server name.
50
+
51
+
**STDIO transport example:**
52
+
53
+
```json
54
+
{
55
+
"command": "node",
56
+
"args": ["build/index.js", "--debug"],
57
+
"env": {
58
+
"API_KEY": "your-api-key",
59
+
"DEBUG": "true"
60
+
}
61
+
}
62
+
```
63
+
64
+
**SSE transport example:**
65
+
66
+
```json
67
+
{
68
+
"type": "sse",
69
+
"url": "http://localhost:3000/events",
70
+
"note": "For SSE connections, add this URL directly in Client"
71
+
}
72
+
```
73
+
74
+
-**Servers File** - Copies a complete MCP configuration file structure to your clipboard, with your current server configuration added as `default-server`. This can be saved directly as `mcp.json`.
75
+
76
+
**STDIO transport example:**
77
+
78
+
```json
79
+
{
80
+
"mcpServers": {
81
+
"default-server": {
82
+
"command": "node",
83
+
"args": ["build/index.js", "--debug"],
84
+
"env": {
85
+
"API_KEY": "your-api-key",
86
+
"DEBUG": "true"
87
+
}
88
+
}
89
+
}
90
+
}
91
+
```
92
+
93
+
**SSE transport example:**
94
+
95
+
```json
96
+
{
97
+
"mcpServers": {
98
+
"default-server": {
99
+
"type": "sse",
100
+
"url": "http://localhost:3000/events",
101
+
"note": "For SSE connections, add this URL directly in Client"
102
+
}
103
+
}
104
+
}
105
+
```
106
+
107
+
These buttons appear in the Inspector UI after you've configured your server settings, making it easy to save and reuse your configurations.
108
+
109
+
For SSE transport connections, the Inspector provides similar functionality for both buttons. The "Server Entry" button copies the SSE URL configuration that can be added to your existing configuration file, while the "Servers File" button creates a complete configuration file containing the SSE URL for direct use in clients.
110
+
111
+
You can paste the Server Entry into your existing `mcp.json` file under your chosen server name, or use the complete Servers File payload to create a new configuration file.
112
+
45
113
### Authentication
46
114
47
115
The inspector supports bearer token authentication for SSE connections. Enter your token in the UI when connecting to an MCP server, and it will be sent in the Authorization header. You can override the header name using the input field in the sidebar.
@@ -93,6 +161,8 @@ Example server configuration file:
93
161
}
94
162
```
95
163
164
+
> **Tip:** You can easily generate this configuration format using the **Server Entry** and **Servers File** buttons in the Inspector UI, as described in the Configuration Export section above.
? "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name."
152
-
: "SSE URL has been copied. Use this URL in Cursor directly.",
153
-
});
149
+
toast({
150
+
title: "Config entry copied",
151
+
description:
152
+
transportType==="stdio"
153
+
? "Server configuration has been copied to clipboard. Add this to your mcp.json inside the 'mcpServers' object with your preferred server name."
154
+
: "SSE URL has been copied. Use this URL in Cursor directly.",
155
+
});
154
156
155
-
setTimeout(()=>{
156
-
setCopiedConfigEntry(false);
157
-
},2000);
157
+
setTimeout(()=>{
158
+
setCopiedServerEntry(false);
159
+
},2000);
160
+
})
161
+
.catch((error)=>{
162
+
toast({
163
+
title: "Error",
164
+
description: `Failed to copy config: ${errorinstanceofError ? error.message : String(error)}`,
165
+
variant: "destructive",
166
+
});
167
+
});
158
168
}catch(error){
159
169
toast({
160
170
title: "Error",
161
171
description: `Failed to copy config: ${errorinstanceofError ? error.message : String(error)}`,
162
172
variant: "destructive",
163
173
});
164
174
}
165
-
},[generateMCPConfigEntry,transportType,toast]);
175
+
},[generateMCPServerEntry,transportType,toast]);
166
176
167
-
consthandleCopyConfigFile=useCallback(()=>{
177
+
consthandleCopyServerFile=useCallback(()=>{
168
178
try{
169
-
constconfigJson=generateMCPConfigFile();
170
-
navigator.clipboard.writeText(configJson);
171
-
setCopiedConfigFile(true);
179
+
constconfigJson=generateMCPServerFile();
180
+
navigator.clipboard
181
+
.writeText(configJson)
182
+
.then(()=>{
183
+
setCopiedServerFile(true);
172
184
173
-
toast({
174
-
title: "Config file copied",
175
-
description: "Server configuration has been copied to clipboard. Add this to your mcp.json file. Current testing server will be added as 'default-server'",
176
-
});
185
+
toast({
186
+
title: "Servers file copied",
187
+
description:
188
+
"Servers configuration has been copied to clipboard. Add this to your mcp.json file. Current testing server will be added as 'default-server'",
189
+
});
177
190
178
-
setTimeout(()=>{
179
-
setCopiedConfigFile(false);
180
-
},2000);
191
+
setTimeout(()=>{
192
+
setCopiedServerFile(false);
193
+
},2000);
194
+
})
195
+
.catch((error)=>{
196
+
toast({
197
+
title: "Error",
198
+
description: `Failed to copy config: ${errorinstanceofError ? error.message : String(error)}`,
199
+
variant: "destructive",
200
+
});
201
+
});
181
202
}catch(error){
182
203
toast({
183
204
title: "Error",
184
205
description: `Failed to copy config: ${errorinstanceofError ? error.message : String(error)}`,
0 commit comments