Created
July 28, 2025 21:22
-
-
Save WebCloud/3e75ae968ca82a3f5a132587b4745c88 to your computer and use it in GitHub Desktop.
MCP example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mcpClient = new MCPClient({ | |
servers: { | |
myServer: { | |
url: new URL('https://my-mcp-server.com'), | |
authorization: { | |
redirectUris: ['http://localhost:3000/oauth/callback'], | |
scopes: ['read', 'write'], | |
onAuthorizationNeeded: async (serverUrl, authUrl, context) => { | |
// Redirect user to authUrl, then call: | |
await mcpClient.provideAuthorizationCode('myServer', code, state); | |
}, | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment