@remit/mcp-server 0.1.1 → 0.2.0
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/dist/app-entry.d.ts +1 -0
- package/dist/app-entry.js +1 -0
- package/dist/auth/authorization-server.d.ts +0 -12
- package/dist/auth/authorization-server.js +0 -2
- package/dist/auth/mcp-database.d.ts +8 -0
- package/dist/auth/mcp-database.js +6 -0
- package/dist/auth/node-auth.js +4 -5
- package/package.json +1 -1
package/dist/app-entry.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { createMcpApp, type McpAppConfig } from "./app.js";
|
|
2
2
|
export { AUTH_BASE_PATH, CONNECTED_APPS_API_PATH, CONNECTED_APPS_PATH, CONSENT_PATH, createBetterAuthTokenVerifier, createMcpAuth, DEVICE_APPROVE_PATH, DEVICE_CODE_PATH, DEVICE_DENY_PATH, DEVICE_PATH, JWKS_PATH, LOGIN_PATH, MCP_PATH, type McpAuth, type McpAuthConfig, type McpAuthRoutes, type McpAuthServer, type McpBrowserAuth, type McpBrowserRoutes, type McpIdentity, type McpSessionState, type McpSignInResult, type McpSubject, mcpResource, OAUTH2_PATH_PREFIX, REVOKE_CLIENT_API_PATH, SIGN_IN_PATH, type SignIn, } from "./auth/authorization-server.js";
|
|
3
|
+
export { type McpSqliteDatabase, type McpUserTables, mcpDatabase, } from "./auth/mcp-database.js";
|
|
3
4
|
export { describeScopes, MCP_READ_SCOPE, MCP_RULES_SCOPE, MCP_SCOPES, OFFLINE_ACCESS_SCOPE, } from "./auth/scopes.js";
|
|
4
5
|
export type { TokenVerification, TokenVerifier, } from "./auth/token-verifier.js";
|
|
5
6
|
export { claudeMcpAddCommand, type DeviceLoginIo, type DeviceLoginResult, deviceLogin, } from "./cli/device-login.js";
|
package/dist/app-entry.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { createMcpApp } from "./app.js";
|
|
2
2
|
export { AUTH_BASE_PATH, CONNECTED_APPS_API_PATH, CONNECTED_APPS_PATH, CONSENT_PATH, createBetterAuthTokenVerifier, createMcpAuth, DEVICE_APPROVE_PATH, DEVICE_CODE_PATH, DEVICE_DENY_PATH, DEVICE_PATH, JWKS_PATH, LOGIN_PATH, MCP_PATH, mcpResource, OAUTH2_PATH_PREFIX, REVOKE_CLIENT_API_PATH, SIGN_IN_PATH, } from "./auth/authorization-server.js";
|
|
3
|
+
export { mcpDatabase, } from "./auth/mcp-database.js";
|
|
3
4
|
export { describeScopes, MCP_READ_SCOPE, MCP_RULES_SCOPE, MCP_SCOPES, OFFLINE_ACCESS_SCOPE, } from "./auth/scopes.js";
|
|
4
5
|
export { claudeMcpAddCommand, deviceLogin, } from "./cli/device-login.js";
|
|
5
6
|
export { mcpDepsOf, } from "./deps.js";
|
|
@@ -77,12 +77,6 @@ export declare const buildMcpAuthOptions: (config: McpAuthConfig, database: Bett
|
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
|
-
user: {
|
|
81
|
-
modelName: "auth_user";
|
|
82
|
-
};
|
|
83
|
-
account: {
|
|
84
|
-
modelName: "auth_account";
|
|
85
|
-
};
|
|
86
80
|
session: {
|
|
87
81
|
modelName: "mcp_session";
|
|
88
82
|
storeSessionInDatabase: true;
|
|
@@ -3450,12 +3444,6 @@ declare const createBetterAuth: (config: McpAuthConfig, database: BetterAuthOpti
|
|
|
3450
3444
|
};
|
|
3451
3445
|
};
|
|
3452
3446
|
};
|
|
3453
|
-
user: {
|
|
3454
|
-
modelName: "auth_user";
|
|
3455
|
-
};
|
|
3456
|
-
account: {
|
|
3457
|
-
modelName: "auth_account";
|
|
3458
|
-
};
|
|
3459
3447
|
session: {
|
|
3460
3448
|
modelName: "mcp_session";
|
|
3461
3449
|
storeSessionInDatabase: true;
|
|
@@ -417,8 +417,6 @@ export const buildMcpAuthOptions = (config, database, identity) => {
|
|
|
417
417
|
enabled: true,
|
|
418
418
|
customRules: { [SIGN_IN_PATH]: { window: 60, max: 5 } },
|
|
419
419
|
},
|
|
420
|
-
user: { modelName: "auth_user" },
|
|
421
|
-
account: { modelName: "auth_account" },
|
|
422
420
|
session: { modelName: "mcp_session", storeSessionInDatabase: true },
|
|
423
421
|
verification: { modelName: "mcp_verification" },
|
|
424
422
|
plugins: [
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BetterAuthOptions } from "better-auth";
|
|
2
|
+
import type { BaseSQLiteDatabase, SQLiteTable } from "drizzle-orm/sqlite-core";
|
|
3
|
+
export interface McpUserTables {
|
|
4
|
+
user: SQLiteTable;
|
|
5
|
+
account: SQLiteTable;
|
|
6
|
+
}
|
|
7
|
+
export type McpSqliteDatabase = BaseSQLiteDatabase<"async" | "sync", unknown, Record<string, unknown>>;
|
|
8
|
+
export declare const mcpDatabase: (db: McpSqliteDatabase, tables: McpUserTables) => BetterAuthOptions["database"];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as mcpTables from "@remit/drizzle-service/schema-sets/mcp";
|
|
2
|
+
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
3
|
+
export const mcpDatabase = (db, tables) => drizzleAdapter(db, {
|
|
4
|
+
provider: "sqlite",
|
|
5
|
+
schema: { ...mcpTables, user: tables.user, account: tables.account },
|
|
6
|
+
});
|
package/dist/auth/node-auth.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { isUserDisabled, writeAudit } from "@remit/auth-service";
|
|
2
2
|
import { auth_account, auth_user } from "@remit/auth-service/schema";
|
|
3
|
-
import * as mcpTables from "@remit/drizzle-service/schema-sets/mcp";
|
|
4
|
-
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
5
3
|
import { createMcpAuth, } from "./authorization-server.js";
|
|
6
4
|
import { refuseSharedTableWrites } from "./database.js";
|
|
5
|
+
import { mcpDatabase } from "./mcp-database.js";
|
|
7
6
|
import { checkRemitPassword } from "./remit-password.js";
|
|
8
|
-
export const createSqliteMcpAuth = (config, db) => createMcpAuth(config,
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const createSqliteMcpAuth = (config, db) => createMcpAuth(config, mcpDatabase(refuseSharedTableWrites(db), {
|
|
8
|
+
user: auth_user,
|
|
9
|
+
account: auth_account,
|
|
11
10
|
}), {
|
|
12
11
|
isDisabled: async (userId) => isUserDisabled(db, userId),
|
|
13
12
|
audit: async (record) => writeAudit(db, record),
|