Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/architecture.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,20 @@ The MCP server supports multiple transport mechanisms:
- Configured via command-line args
- This is the standard MCP transport

**HTTP/SSE Transport** (For web apps):
**HTTP Transport** (For web apps):

- Allows web applications to connect to MCP
- Allows web applications to connect to MCP via HTTP streaming
- Used by the example Cloudflare chat app
- Main endpoint: `/mcp`
- Not part of core MCP spec

**SSE Transport** (Deprecated - will be removed):

- Legacy Server-Sent Events transport
- Endpoint: `/sse`
- Does not support organization/project constraints
- New integrations should use HTTP transport via `/mcp` endpoint

### 3. Authentication Strategy

The MCP server uses Sentry access tokens for authentication:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "../ui/accordion";
import { Accordion } from "../ui/accordion";
import CodeSnippet from "../ui/code-snippet";
import SetupGuide from "./setup-guide";
import { Prose } from "../ui/prose";
Expand All @@ -15,7 +10,6 @@ const mcpServerName = import.meta.env.DEV ? "sentry-dev" : "sentry";

export default function RemoteSetup() {
const endpoint = new URL("/mcp", window.location.href).href;
const sseEndpoint = new URL("/sse", window.location.href).href;

const mcpRemoteSnippet = `npx ${NPM_REMOTE_NAME}@latest ${endpoint}`;
// the shared configuration for all clients
Expand Down Expand Up @@ -75,24 +69,6 @@ export default function RemoteSetup() {
session to a specific organization and project
</li>
</ul>
<Accordion type="single" collapsible>
<AccordionItem value="sse-deprecated">
<AccordionTrigger>SSE support is deprecated</AccordionTrigger>
<AccordionContent>
<p className="mb-2">
New clients should use HTTP Streaming via the main
<code>/mcp</code> endpoint. If you must use the SSE-only
implementation, use the following URL:
</p>
<CodeSnippet noMargin snippet={sseEndpoint} />
<p className="mt-2">
<strong>Limitations:</strong> SSE endpoints do not support
organization or project constraints. Use the main
<code>/mcp</code> endpoint if you need scoped access.
</p>
</AccordionContent>
</AccordionItem>
</Accordion>
</Prose>
<Heading as="h3">Integration Guides</Heading>
<Accordion type="single" collapsible>
Expand Down
10 changes: 5 additions & 5 deletions packages/mcp-test-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A simple CLI tool to test the Sentry MCP server using stdio transport with an AI
- 💬 Interactive mode by default when no prompt provided
- 🎨 Colorized output for better readability
- 🔄 Streaming responses for real-time feedback
- 🌐 Remote MCP server support via SSE transport (with OAuth)
- 🌐 Remote MCP server support via HTTP streaming (with OAuth)
- 🏠 Local stdio transport for development

## Prerequisites
Expand Down Expand Up @@ -86,7 +86,7 @@ The client automatically determines the connection mode:
2. Environment variable (`SENTRY_ACCESS_TOKEN`)
3. `.env` file

**Remote Mode (SSE transport)**: Used when no access token is provided, prompts for OAuth authentication
**Remote Mode (HTTP streaming)**: Used when no access token is provided, prompts for OAuth authentication

### Required Sentry Permissions

Expand All @@ -103,17 +103,17 @@ Your Sentry access token needs the following scopes:

### Remote Mode (Default)

Connect to the remote MCP server via SSE transport (uses OAuth for authentication):
Connect to the remote MCP server via HTTP streaming (uses OAuth for authentication):

```bash
# Connect to production MCP server (uses /sse endpoint)
# Connect to production MCP server (uses /mcp endpoint)
pnpm mcp-test-client

# Connect to local development MCP server
pnpm mcp-test-client --mcp-host http://localhost:8787
```

**Note**: Remote mode uses Server-Sent Events (SSE) transport and connects to the `/sse` endpoint on the MCP server.
**Note**: Remote mode uses HTTP streaming transport and connects to the `/mcp` endpoint on the MCP server.

### Local Mode

Expand Down
1 change: 1 addition & 0 deletions packages/mcp-test-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"dependencies": {
"@ai-sdk/openai": "catalog:",
"@modelcontextprotocol/sdk": "catalog:",
"@sentry/core": "catalog:",
"@sentry/mcp-server": "workspace:*",
"@sentry/node": "catalog:",
Expand Down
28 changes: 17 additions & 11 deletions packages/mcp-test-client/src/mcp-test-client-remote.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { experimental_createMCPClient } from "ai";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
import { startNewTrace, startSpan } from "@sentry/core";
import { OAuthClient } from "./auth/oauth.js";
import { DEFAULT_MCP_URL } from "./constants.js";
Expand All @@ -15,9 +16,9 @@ export async function connectToRemoteMCPServer(
return await startNewTrace(async () => {
return await startSpan(
{
name: "mcp.connect/sse",
name: "mcp.connect/http",
attributes: {
"mcp.transport": "sse",
"mcp.transport": "http",
"gen_ai.conversation.id": sessionId,
"service.version": LIB_VERSION,
},
Expand Down Expand Up @@ -54,16 +55,21 @@ export async function connectToRemoteMCPServer(
);
}

// Create SSE client with authentication
const client = await experimental_createMCPClient({
name: "mcp.sentry.dev (test-client)",
transport: {
type: "sse" as const,
url: `${mcpHost}/sse`,
headers: {
Authorization: `Bearer ${accessToken}`,
// Create HTTP streaming client with authentication
const httpTransport = new StreamableHTTPClientTransport(
new URL(`${mcpHost}/mcp`),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
},
},
},
);

const client = await experimental_createMCPClient({
name: "mcp.sentry.dev (test-client)",
transport: httpTransport,
});

// Discover available tools
Expand Down Expand Up @@ -91,7 +97,7 @@ export async function connectToRemoteMCPServer(
tools,
disconnect,
sessionId,
transport: "sse" as const,
transport: "http" as const,
};
} catch (error) {
span.setStatus({ code: 2 });
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-test-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface MCPConnection {
tools: Map<string, any>;
disconnect: () => Promise<void>;
sessionId: string;
transport: "stdio" | "sse";
transport: "stdio" | "http";
}

export interface MCPConfig {
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.