@shivaedev/mcp 0.10.0 → 0.10.2
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.
- package/CHANGELOG.md +12 -0
- package/README.md +19 -16
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.2 - 2026-11-21
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update `@shivaedev/identity` from 0.38.0 to 0.38.1.
|
|
8
|
+
|
|
9
|
+
## 0.10.1 - 2026-11-21
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Update `@shivaedev/identity` from 0.37.0 to 0.38.0.
|
|
14
|
+
|
|
3
15
|
## 0.10.0 - 2026-11-21
|
|
4
16
|
|
|
5
17
|
### 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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
`
|
|
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.
|
|
3
|
+
"version": "0.10.2",
|
|
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.
|
|
48
|
+
"@shivaedev/identity": "0.38.1"
|
|
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.
|
|
53
|
+
"@shivaedev/quality": "0.83.0",
|
|
54
54
|
"@shivaedev/rate-limit": "0.8.0",
|
|
55
|
-
"@shivaedev/server": "0.
|
|
56
|
-
"@shivaedev/test-kits": "0.
|
|
55
|
+
"@shivaedev/server": "0.41.0",
|
|
56
|
+
"@shivaedev/test-kits": "0.16.1",
|
|
57
57
|
"@shivaedev/test-sql": "0.26.0",
|
|
58
|
-
"@shivaedev/test-story": "0.
|
|
58
|
+
"@shivaedev/test-story": "0.52.1",
|
|
59
59
|
"@types/node": "24.19.2",
|
|
60
60
|
"better-auth": "1.7.22",
|
|
61
61
|
"effect": "4.1.4",
|