{// Browser configuration
browser?:{// Browser type to use (chromium, firefox, or webkit)
browserName?:'chromium'|'firefox'|'webkit';// Path to user data directory for browser profile persistence
userDataDir?:string;// Browser launch options (see Playwright docs)
// @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch
launchOptions?:{channel?:string;// Browser channel (e.g. 'chrome')
headless?:boolean;// Run in headless mode
executablePath?:string;// Path to browser executable
// ... other Playwright launch options
};// Browser context options
// @see https://playwright.dev/docs/api/class-browser#browser-new-context
contextOptions?:{viewport?:{width:number,height:number};// ... other Playwright context options
};// CDP endpoint for connecting to existing browser
cdpEndpoint?:string;// Remote Playwright server endpoint
remoteEndpoint?:string;},// Server configuration
server?:{port?:number;// Port to listen on
host?:string;// Host to bind to (default: localhost)
},// List of enabled capabilities
capabilities?:Array<'core'|// Core browser automation
'tabs'|// Tab management
'pdf'|// PDF generation
'history'|// Browser history
'wait'|// Wait utilities
'files'|// File handling
'install'// Browser installation
>;// Enable vision mode (screenshots instead of accessibility snapshots)
vision?:boolean;// Directory for output files
outputDir?:string;// Tool-specific configurations
tools?:{browser_take_screenshot?:{// Disable base64-encoded image responses
omitBase64?:boolean;}}}
{"mcpServers":{"github":{"command":"docker","args":["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"],"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"Your GitHub Personal Access Token"}}}}
单个开发项目MCP服务器配置方法
在.cursor/mcp.json 加入MCP Server的配置,和全局方式类似。
VS Code MCP 使用
VS Code支持MCP服务器传输的本地标准输入/输出(stdio)和服务器发送事件(sse)。目前,在三个原语(tools, prompts, resources)中,服务器只能向Copilot的代理模式提供工具。工具的列表和描述可以使用列表更改事件动态更新。VS Code使用roots(规范)向服务器提供当前工作区文件夹。
{// 💡 Inputs are prompted on first server start, then stored securely by VS Code.
"inputs":[{"type":"promptString","id":"perplexity-key","description":"Perplexity API Key","password":true}],"servers":{// https://github.com/ppl-ai/modelcontextprotocol/
"Perplexity":{"type":"stdio","command":"npx","args":["-y","@modelcontextprotocol/server-perplexity-ask"],"env":{"PERPLEXITY_API_KEY":"${input:perplexity-key}"}}}}
// Example .vscode/mcp.json
{// 💡 Inputs will be prompted on first server start,
// then stored securely by VS Code.
"inputs":[{"type":"promptString","id":"perplexity-key","description":"Perplexity API Key","password":true}],"servers":{// https://github.com/ppl-ai/modelcontextprotocol/
"Perplexity":{"type":"stdio","command":"docker","args":["run","-i","--rm","-e","PERPLEXITY_API_KEY","mcp/perplexity-ask"],"env":{"PERPLEXITY_API_KEY":"${input:perplexity-key}"}},// https://github.com/modelcontextprotocol/servers/tree/main/src/fetch
"fetch":{"type":"stdio","command":"uvx","args":["mcp-server-fetch"]},"my-remote-server":{"type":"sse","url":"http://api.contoso.com/sse","headers":{"VERSION":"1.2"}}}}