File tree Expand file tree Collapse file tree
src/steps/add-mcp-server-to-clients Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ export abstract class DefaultMCPClient extends MCPClient {
3636 }
3737
3838 async addServer ( apiKey : string ) : Promise < { success : boolean } > {
39+ return this . _addServerType ( apiKey , 'streamable-http' ) ;
40+ }
41+
42+ async _addServerType (
43+ apiKey : string ,
44+ type : 'sse' | 'streamable-http' ,
45+ ) : Promise < { success : boolean } > {
3946 try {
4047 const configPath = await this . getConfigPath ( ) ;
4148 const configDir = path . dirname ( configPath ) ;
@@ -44,7 +51,7 @@ export abstract class DefaultMCPClient extends MCPClient {
4451
4552 const newServerConfig = {
4653 mcpServers : {
47- posthog : getDefaultServerConfig ( apiKey ) ,
54+ posthog : getDefaultServerConfig ( apiKey , type ) ,
4855 } ,
4956 } ;
5057
Original file line number Diff line number Diff line change @@ -324,7 +324,10 @@ describe('ClaudeMCPClient', () => {
324324
325325 await client . addServer ( mockApiKey ) ;
326326
327- expect ( getDefaultServerConfigMock ) . toHaveBeenCalledWith ( mockApiKey ) ;
327+ expect ( getDefaultServerConfigMock ) . toHaveBeenCalledWith (
328+ mockApiKey ,
329+ 'streamable-http' ,
330+ ) ;
328331 } ) ;
329332 } ) ;
330333
Original file line number Diff line number Diff line change @@ -24,4 +24,8 @@ export class CursorMCPClient extends DefaultMCPClient {
2424 async getConfigPath ( ) : Promise < string > {
2525 return Promise . resolve ( path . join ( os . homedir ( ) , '.cursor' , 'mcp.json' ) ) ;
2626 }
27+
28+ async addServer ( apiKey : string ) : Promise < { success : boolean } > {
29+ return this . _addServerType ( apiKey , 'sse' ) ;
30+ }
2731}
Original file line number Diff line number Diff line change @@ -13,12 +13,17 @@ export const DefaultMCPClientConfig = z
1313 } )
1414 . passthrough ( ) ;
1515
16- export const getDefaultServerConfig = ( apiKey : string ) => ( {
16+ type MCPServerType = 'sse' | 'streamable-http' ;
17+
18+ export const getDefaultServerConfig = (
19+ apiKey : string ,
20+ type : MCPServerType ,
21+ ) => ( {
1722 command : 'npx' ,
1823 args : [
1924 '-y' ,
2025 'mcp-remote@latest' ,
21- ' https://mcp.posthog.com/mcp',
26+ ` https://mcp.posthog.com/${ type === 'sse' ? 'sse' : ' mcp'} ` ,
2227 '--header' ,
2328 `Authorization:\${POSTHOG_AUTH_HEADER}` ,
2429 ] ,
You can’t perform that action at this time.
0 commit comments