Add MCP proxy address config support, better error messages
This commit is contained in:
parent
fa7f9c80cd
commit
51c7eda6a6
1 changed files with 483 additions and 87 deletions
|
|
@ -38,7 +38,7 @@ app.use(cors());
|
|||
|
||||
let webAppTransports: SSEServerTransport[] = [];
|
||||
|
||||
const createTransport = async (req: express.Request) => {
|
||||
const createTransport = async (req: express.Request): Promise<Transport> => {
|
||||
const query = req.query;
|
||||
console.log("Query parameters:", query);
|
||||
|
||||
|
|
@ -70,6 +70,7 @@ const createTransport = async (req: express.Request) => {
|
|||
const headers: HeadersInit = {
|
||||
Accept: "text/event-stream",
|
||||
};
|
||||
|
||||
for (const key of SSE_HEADERS_PASSTHROUGH) {
|
||||
if (req.headers[key] === undefined) {
|
||||
continue;
|
||||
|
|
@ -172,6 +173,12 @@ app.post("/message", async (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
app.get("/health", (req, res) => {
|
||||
res.json({
|
||||
status: "ok",
|
||||
});
|
||||
});
|
||||
|
||||
app.get("/config", (req, res) => {
|
||||
try {
|
||||
res.json({
|
||||
|
|
|
|||
Loading…
Reference in a new issue