sets stdio as the default transport
This is a breaking change, requiring a new major release of the server. Resolves https://github.com/brave/brave-search-mcp-server/issues/63
This commit is contained in:
1 parent
f3c0a65fec
commit
0bca1a42b3
4 files changed
+16
-13
No files matched your search
+6
-2
@@ -25,7 +25,7 @@ type Configuration = {
|
||||
};
|
||||
|
||||
const state: Configuration & { ready: boolean } = {
|
||||
transport: 'http',
|
||||
transport: 'stdio',
|
||||
port: 8080,
|
||||
host: '0.0.0.0',
|
||||
braveApiKey: process.env.BRAVE_API_KEY ?? '',
|
||||
@@ -37,7 +37,11 @@ export function getOptions(): Configuration | false {
|
||||
const program = new Command()
|
||||
.option('--brave-api-key <string>', 'Brave API key', process.env.BRAVE_API_KEY ?? '')
|
||||
.option('--logging-level <string>', 'Logging level', process.env.BRAVE_MCP_LOG_LEVEL ?? 'info')
|
||||
.option('--transport <stdio|http>', 'transport type', process.env.BRAVE_MCP_TRANSPORT ?? 'http')
|
||||
.option(
|
||||
'--transport <stdio|http>',
|
||||
'transport type',
|
||||
process.env.BRAVE_MCP_TRANSPORT ?? 'stdio'
|
||||
)
|
||||
.option(
|
||||
'--port <number>',
|
||||
'desired port for HTTP transport',
|
||||
|
||||
+4
-5
@@ -10,14 +10,13 @@ async function main() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// stdio requires explicit request
|
||||
if (options.transport === 'stdio') {
|
||||
await stdioServer.start();
|
||||
// default to stdio server unless http is explicitly requested
|
||||
if (options.transport === 'http') {
|
||||
httpServer.start();
|
||||
return;
|
||||
}
|
||||
|
||||
// default to http server
|
||||
httpServer.start();
|
||||
await stdioServer.start();
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
|
||||
Reference in new issue
Block a user