examples: web-standard twin of the bearer-auth story (#2424)
This commit is contained in:
parent
e8de519d31
commit
7015d2129b
1 changed files with 170 additions and 0 deletions
18
examples/bearer-auth-web/README.md
Normal file
18
examples/bearer-auth-web/README.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# bearer-auth-web
|
||||
|
||||
The web-standard twin of [`bearer-auth`](../bearer-auth/): the same minimal
|
||||
Resource-Server-only story built entirely from `@modelcontextprotocol/server`
|
||||
exports, with no framework.
|
||||
|
||||
Host and origin validation plus `requireBearerAuth` gate `createMcpHandler`,
|
||||
composed as one `fetch(request)` handler. On Cloudflare Workers, Deno, or Bun
|
||||
that handler is the whole server; `toNodeHandler` bridges it onto `node:http`
|
||||
so the story runs in this repo's example matrix.
|
||||
|
||||
No Authorization Server and no discovery documents here, matching the sibling
|
||||
— see [`oauth`](../oauth/) for the full RS + AS dance.
|
||||
|
||||
```sh
|
||||
pnpm --filter @mcp-examples/bearer-auth-web server -- --http --port 3000
|
||||
pnpm --filter @mcp-examples/bearer-auth-web client -- --http http://127.0.0.1:3000/mcp
|
||||
```
|
||||
Loading…
Reference in a new issue