-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
For competitiveness consideration, Gopher-Auth-SDK provides 3 usages:
- User provides MCP tools only.
import dotenv from "dotenv";
import { GopherAuthServer } from "@mcp/filter-sdk/auth";
import { tool1 } from "./tools/tool1.js";
import { tool2 } from "./tools/tool2.js";
import { tool3 } from "./tools/tool3.js";
dotenv.config();
const tools = [tool1, tool2, tool3];
const server = new GopherAuthServer();
server.register(tools);
server.start().catch(error => {
console.error("Fatal error:", error);
process.exit(1);
});
- User provides MCP Server and tools.
import dotenv from "dotenv";
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { GopherAuthServer } from "@mcp/filter-sdk/auth";
import { tool1 } from "./tools/tool1.js";
import { tool2 } from "./tools/tool2.js";
import { tool3 } from "./tools/tool3.js";
dotenv.config();
const mcpServer = new Server(
{
name: "example-server",
version: "1.0.0"
},
{
capabilities: {
tools: {}
},
}
);
mcpServer.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [tool1, tool2, tool3],
};
});
const server = new GopherAuthServer(mcpServer);
server.start().catch(error => {
console.error("Fatal error:", error);
process.exit(1);
});
- User handles server manually, Gopher-Auth SDK provides authentication middleware.
Metadata
Metadata
Assignees
Labels
No labels