Merge branch 'main' into fix-env-var-parsing

This commit is contained in:
Ryan Rozich
2025-03-15 14:27:46 -05:00
committed by GitHub
3 changed files with 12 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ const SamplingTab = ({ pendingRequests, onApprove, onReject }: Props) => {
<h3 className="text-lg font-semibold">Recent Requests</h3>
{pendingRequests.map((request) => (
<div key={request.id} className="p-4 border rounded-lg space-y-4">
<pre className="bg-gray-50 p-2 rounded">
<pre className="bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-2 rounded">
{JSON.stringify(request.request, null, 2)}
</pre>
<div className="flex space-x-2">

View File

@@ -10,6 +10,7 @@ import {
ListRootsRequestSchema,
ProgressNotificationSchema,
ResourceUpdatedNotificationSchema,
LoggingMessageNotificationSchema,
Request,
Result,
ServerCapabilities,
@@ -26,6 +27,7 @@ import { SESSION_KEYS } from "../constants";
import { Notification, StdErrNotificationSchema } from "../notificationTypes";
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
import { authProvider } from "../auth";
import packageJson from "../../../package.json";
const params = new URLSearchParams(window.location.search);
const DEFAULT_REQUEST_TIMEOUT_MSEC =
@@ -205,7 +207,7 @@ export function useConnection({
const client = new Client<Request, Notification, Result>(
{
name: "mcp-inspector",
version: "0.0.1",
version: packageJson.version,
},
{
capabilities: {
@@ -257,6 +259,11 @@ export function useConnection({
ResourceUpdatedNotificationSchema,
onNotification,
);
client.setNotificationHandler(
LoggingMessageNotificationSchema,
onNotification,
);
}
if (onStdErrNotification) {

View File

@@ -66,7 +66,9 @@ const createTransport = async (req: express.Request) => {
return transport;
} else if (transportType === "sse") {
const url = query.url as string;
const headers: HeadersInit = {};
const headers: HeadersInit = {
Accept: "text/event-stream",
};
for (const key of SSE_HEADERS_PASSTHROUGH) {
if (req.headers[key] === undefined) {
continue;