@@ -6,43 +6,33 @@ import {
66
77describe ( 'defaults' , ( ) => {
88 describe ( 'buildMCPUrl' , ( ) => {
9- it ( 'should build base URL for streamable-http type ' , ( ) => {
10- const url = buildMCPUrl ( 'streamable-http' ) ;
9+ it ( 'should build base URL' , ( ) => {
10+ const url = buildMCPUrl ( ) ;
1111 expect ( url ) . toBe ( 'https://mcp.posthog.com/mcp' ) ;
1212 } ) ;
1313
14- it ( 'should build base URL for sse type' , ( ) => {
15- const url = buildMCPUrl ( 'sse' ) ;
16- expect ( url ) . toBe ( 'https://mcp.posthog.com/sse' ) ;
17- } ) ;
18-
1914 it ( 'should use localhost for local mode' , ( ) => {
20- const url = buildMCPUrl ( 'streamable-http' , undefined , true ) ;
15+ const url = buildMCPUrl ( undefined , true ) ;
2116 expect ( url ) . toBe ( 'http://localhost:8787/mcp' ) ;
2217 } ) ;
2318
2419 it ( 'should add features param when not all features selected' , ( ) => {
25- const url = buildMCPUrl ( 'streamable-http' , [ 'dashboards' , 'insights' ] ) ;
20+ const url = buildMCPUrl ( [ 'dashboards' , 'insights' ] ) ;
2621 expect ( url ) . toBe (
2722 'https://mcp.posthog.com/mcp?features=dashboards,insights' ,
2823 ) ;
2924 } ) ;
30-
31- it ( 'should not add region param in local mode' , ( ) => {
32- const url = buildMCPUrl ( 'streamable-http' , undefined , true ) ;
33- expect ( url ) . toBe ( 'http://localhost:8787/mcp' ) ;
34- } ) ;
3525 } ) ;
3626
3727 describe ( 'getDefaultServerConfig' , ( ) => {
3828 it ( 'should return config with auth header when API key provided' , ( ) => {
39- const config = getDefaultServerConfig ( 'phx_test123' , 'sse' ) ;
29+ const config = getDefaultServerConfig ( 'phx_test123' ) ;
4030 expect ( config ) . toEqual ( {
4131 command : 'npx' ,
4232 args : [
4333 '-y' ,
4434 'mcp-remote@latest' ,
45- 'https://mcp.posthog.com/sse ' ,
35+ 'https://mcp.posthog.com/mcp ' ,
4636 '--header' ,
4737 'Authorization:${POSTHOG_AUTH_HEADER}' ,
4838 ] ,
@@ -53,21 +43,18 @@ describe('defaults', () => {
5343 } ) ;
5444
5545 it ( 'should return config without auth header for OAuth mode (no API key)' , ( ) => {
56- const config = getDefaultServerConfig ( undefined , 'sse' ) ;
46+ const config = getDefaultServerConfig ( undefined ) ;
5747 expect ( config ) . toEqual ( {
5848 command : 'npx' ,
59- args : [ '-y' , 'mcp-remote@latest' , 'https://mcp.posthog.com/sse ' ] ,
49+ args : [ '-y' , 'mcp-remote@latest' , 'https://mcp.posthog.com/mcp ' ] ,
6050 } ) ;
6151 expect ( config ) . not . toHaveProperty ( 'env' ) ;
6252 } ) ;
6353 } ) ;
6454
6555 describe ( 'getNativeHTTPServerConfig' , ( ) => {
6656 it ( 'should return config with headers when API key provided' , ( ) => {
67- const config = getNativeHTTPServerConfig (
68- 'phx_test123' ,
69- 'streamable-http' ,
70- ) ;
57+ const config = getNativeHTTPServerConfig ( 'phx_test123' ) ;
7158 expect ( config ) . toEqual ( {
7259 url : 'https://mcp.posthog.com/mcp' ,
7360 headers : {
@@ -77,7 +64,7 @@ describe('defaults', () => {
7764 } ) ;
7865
7966 it ( 'should return config without headers for OAuth mode (no API key)' , ( ) => {
80- const config = getNativeHTTPServerConfig ( undefined , 'streamable-http' ) ;
67+ const config = getNativeHTTPServerConfig ( undefined ) ;
8168 expect ( config ) . toEqual ( {
8269 url : 'https://mcp.posthog.com/mcp' ,
8370 } ) ;
0 commit comments