@remit/mcp-server 0.1.1 → 0.2.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.
@@ -1,5 +1,7 @@
1
+ export { CLIENT_IP_HEADER } from "@remit/auth-service/constants";
1
2
  export { createMcpApp, type McpAppConfig } from "./app.js";
2
3
  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";
4
+ export { type McpSqliteDatabase, type McpUserTables, mcpDatabase, } from "./auth/mcp-database.js";
3
5
  export { describeScopes, MCP_READ_SCOPE, MCP_RULES_SCOPE, MCP_SCOPES, OFFLINE_ACCESS_SCOPE, } from "./auth/scopes.js";
4
6
  export type { TokenVerification, TokenVerifier, } from "./auth/token-verifier.js";
5
7
  export { claudeMcpAddCommand, type DeviceLoginIo, type DeviceLoginResult, deviceLogin, } from "./cli/device-login.js";
package/dist/app-entry.js CHANGED
@@ -1,5 +1,7 @@
1
+ export { CLIENT_IP_HEADER } from "@remit/auth-service/constants";
1
2
  export { createMcpApp } from "./app.js";
2
3
  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";
4
+ export { mcpDatabase, } from "./auth/mcp-database.js";
3
5
  export { describeScopes, MCP_READ_SCOPE, MCP_RULES_SCOPE, MCP_SCOPES, OFFLINE_ACCESS_SCOPE, } from "./auth/scopes.js";
4
6
  export { claudeMcpAddCommand, deviceLogin, } from "./cli/device-login.js";
5
7
  export { mcpDepsOf, } from "./deps.js";
@@ -1,5 +1,5 @@
1
1
  import { type OAuthOptions, type Scope } from "@better-auth/oauth-provider";
2
- import type { AuditRecord } from "@remit/auth-service";
2
+ import { type AuditRecord } from "@remit/auth-service/constants";
3
3
  import { type BetterAuthOptions, type GenericEndpointContext } from "better-auth";
4
4
  import { z } from "zod";
5
5
  import type { TokenVerifier } from "./token-verifier.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
+ });
@@ -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, drizzleAdapter(refuseSharedTableWrites(db), {
9
- provider: "sqlite",
10
- schema: { ...mcpTables, auth_user, auth_account },
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),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/mcp-server",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "The remit MCP server: mail tools over streamable HTTP and the OAuth authorization server that guards them.",
5
5
  "type": "module",
6
6
  "exports": {