@shivaedev/mcp 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +19 -16
  3. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.1 - 2026-11-21
4
+
5
+ ### Changed
6
+
7
+ - Update `@shivaedev/identity` from 0.37.0 to 0.38.0.
8
+
3
9
  ## 0.10.0 - 2026-11-21
4
10
 
5
11
  ### Breaking
package/README.md CHANGED
@@ -97,6 +97,7 @@ The Better Auth adapter is an optional edge module. Add its provider to the auth
97
97
  import { admin, jwt } from "better-auth/plugins";
98
98
  import { Effect, Layer } from "effect";
99
99
  import { HttpRouter } from "effect/http";
100
+ import { defineAuth } from "@shivaedev/identity/server/better-auth/define.ts";
100
101
  import { betterAuthMount } from "@shivaedev/identity/server/better-auth/mount.ts";
101
102
  import { betterAuthOauthGrants } from "@shivaedev/identity/server/better-auth/adapters/oauthGrants.ts";
102
103
  import { trustedOrigins } from "@shivaedev/identity/server/trustedOrigins.ts";
@@ -108,21 +109,23 @@ import { appHost } from "@shivaedev/server/appDatabase.ts";
108
109
  const application = Effect.gen(function* () {
109
110
  const resource = "https://app.example.com/mcp";
110
111
  const mounted = yield* betterAuthMount(
111
- {
112
- baseURL: "https://app.example.com",
113
- database: authPool,
114
- plugins: [
115
- jwt(),
116
- mcpProvider({
117
- resource,
118
- loginPage: "/login",
119
- consentPage: "/consent",
120
- allowDynamicClientRegistration: true,
121
- allowUnauthenticatedClientRegistration: true,
122
- }),
123
- ],
124
- },
125
- { roles: Roles },
112
+ defineAuth({
113
+ defaultRole: "user",
114
+ options: {
115
+ baseURL: "https://app.example.com",
116
+ plugins: [
117
+ jwt(),
118
+ mcpProvider({
119
+ resource,
120
+ loginPage: "/login",
121
+ consentPage: "/consent",
122
+ allowDynamicClientRegistration: true,
123
+ allowUnauthenticatedClientRegistration: true,
124
+ }),
125
+ ],
126
+ },
127
+ roles: Roles,
128
+ }),
126
129
  );
127
130
  const origin = trustedOrigins({ allow: ["https://app.example.com"], missing: "allow" });
128
131
  const grants = betterAuthOauthGrants({ auth: mounted.auth, admitsUser: mounted.admitsUser });
@@ -146,7 +149,7 @@ const application = Effect.gen(function* () {
146
149
  });
147
150
  ```
148
151
 
149
- `authPool`, `Api` and `Handlers` are the application's existing auth database, RPC group and handlers. Run the Better Auth migrations with the OAuth and JWT plugins included. For existing role management, keep the application's existing role plugin and `RoleSet` in this configuration.
152
+ `Api` and `Handlers` are the application's existing RPC group and handlers; the mount opens Better Auth on the application's SQL client. Run the Better Auth migrations with the OAuth and JWT plugins included. For existing role management, keep the application's existing role plugin and `RoleSet` in this configuration.
150
153
 
151
154
  The edge adapter verifies access-token signatures, issuer, endpoint audience, `mcp` scope and the `grant_id` reference, then asks identity’s `OauthGrants` service to resolve that exact grant. The identity Better Auth Layer loads the current user and referenced consent, requires `mcp` in the consent’s current scopes and checks `mounted.admitsUser` afresh on every request. Admission changes apply to the next request with the same token. A failed admission lookup answers `503` without an OAuth challenge. Denied or banned users and clients without the referenced consent receive the same unauthorized response as invalid tokens. Identity resolves the stored role on each request. An invalid token receives `401` with a `WWW-Authenticate` protected-resource metadata pointer. The metadata names the authorization server and its discovery endpoint, so a client can start OAuth. MCP bearer credentials are separate from browser session cookies. The OAuth session policy refuses requests carrying a Cookie header, including requests that also carry a valid bearer token. Provide the OAuth policy Layer to the MCP routes before merging them with a cookie-authenticated host.
152
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/mcp",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Identity-aware Effect MCP tools mounted on the application host",
5
5
  "keywords": [
6
6
  "effect"
@@ -45,17 +45,17 @@
45
45
  "dependencies": {
46
46
  "@shivaedev/access": "0.7.0",
47
47
  "@shivaedev/errors": "0.14.1",
48
- "@shivaedev/identity": "0.37.0"
48
+ "@shivaedev/identity": "0.38.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@effect/platform-node": "4.1.4",
52
52
  "@effect/sql-pg": "4.1.4",
53
- "@shivaedev/quality": "0.82.0",
53
+ "@shivaedev/quality": "0.82.1",
54
54
  "@shivaedev/rate-limit": "0.8.0",
55
- "@shivaedev/server": "0.39.0",
56
- "@shivaedev/test-kits": "0.15.0",
55
+ "@shivaedev/server": "0.40.0",
56
+ "@shivaedev/test-kits": "0.16.0",
57
57
  "@shivaedev/test-sql": "0.26.0",
58
- "@shivaedev/test-story": "0.51.0",
58
+ "@shivaedev/test-story": "0.52.0",
59
59
  "@types/node": "24.19.2",
60
60
  "better-auth": "1.7.22",
61
61
  "effect": "4.1.4",