@boxxy/auth-oauth
v0.3.2
Published
boxxy's public door: an OAuth server for the owner's MCP endpoint, with passkey sign-in
Readme
boxxy's public door: it lets the owner's assistant reach the owner's MCP tools from anywhere, with a
grant that the owner approved with a passkey. The OAuth server is
@zgeoff/mcp-auth; this package opens it on
boxxy's auth database, with boxxy's scopes and table names.
Install
Install the package from npm with Bun:
bun add @boxxy/auth-oauthThe package runs on Bun 1.3 or newer.
Features
createPublicDoor(options)opens and migrates the auth database and returns the door:answerRequestfor each request,addLocalPortfor the loopback address,adminfor the owner's commands,authfor the test helpers, andstop.- The door serves MCP at
/mcpand at/, the OAuth routes, the two.well-knowndocuments and the sign-in pages, and answers 404 on any other path. - It checks the
HostandOriginheaders, verifies each bearer token, and passes the verified token to theserveMCPcallback that the app gives it. - It writes each sign-in outcome and each refused token to
writeSecurityLineas a JSON line. adminenrolls a passkey, adds and removes clients, and lists and revokes grants.- With
serviceTokens, the door signs in the service clients of a service-token file with theclient_credentialsgrant. It reads the file again on SIGHUP, and passes each outcome toonReload: the clients replaced, or the old clients kept with the reason. mintServiceSecret()draws a service client's secret and its digest, for the file../test-utils/authorize-test-clientsigns a client in throughdoor.authwith a stub passkey, for tests.
Documentation
The public door describes the endpoints, the scopes and the token lifetimes, and 0018 records the decision.
