@civic/nexus-bridge
Version:
Stdio <-> HTTP/SSE MCP bridge with Civic auth handling
48 lines • 2.52 kB
JavaScript
/**
* config.ts
*
* Centralizes configuration management, loading environment variables
* and providing defaults for all nexus bridge settings.
*/
import { config } from 'dotenv';
// Load environment variables first
config();
// Main configuration - values from environment variables
export const REMOTE_MCP_URL = process.env.MCP_REMOTE_URL || 'https://ai.civic.com/hub/mcp/sse';
// Authentication configuration
export const CIVIC_AUTH_URL = process.env.CIVIC_AUTH_URL || 'https://auth.civic.com/oauth';
// Civic MCP - Public app
export const CLIENT_ID = process.env.CIVIC_AUTH_CLIENT_ID || '12220cf4-1a9a-4964-8eb7-7c6d7d049f34';
// If true, bypass login and use CLIENT_ID directly as the bearer token
export const NO_LOGIN = process.env.NO_LOGIN === 'true';
// If true, bypass third-party service authorization captures (don't open authorization URLs)
export const NO_AUTH_CAPTURE = process.env.NO_AUTH_CAPTURE === 'true';
export const REQUEST_TIMEOUT_MS = parseInt(process.env.REQUEST_TIMEOUT_MS || '60000', 10); // 60 seconds by default, increased from 30s
// The default public key for encrypting tokens - maps to a private key held by the authz web app in production
export const TOKEN_ENCRYPTION_PUBLIC_KEY_PROD = '-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsu+oMpl/yT5oiqLMvfuQ\ne43S8S0eu59Qbax4M7DfWjimw3gVmK5KcR7TB4v4vlZsvF91vCT6ArYs8Ke9gGsB\nDNgVS20WE6GB5biEUIiYDKlremBGlYxzHoVIrOvTH7WS8KpogpNJpqFV735aTVoy\nHOetl4Ap6tXkznLeBllirMpntJS3vVUW/+L5YGiY7aSuRwfoXphLItfamWos3/Ff\nz33FjrQY6bb6g+vdTtq8JLkiOXKynEcaGYXGibnkDc5C+jKx2JS63TOpp1LbvEmh\njEXpaee94YTs99H3LdqsporedAwEXKFrmX76eXrlIYei+ZUubrCToFkCXRzjwGMU\n9wIDAQAB\n-----END PUBLIC KEY-----\n';
// Callback server configuration
export const CALLBACK_PORT = parseInt(process.env.CALLBACK_PORT || '8976', 10);
// Info the bridge presents locally to Claude Desktop
export const LOCAL_SERVER_INFO = {
name: 'CivicNexusBridge-Local',
version: '0.1.0'
};
// Info the bridge presents to the remote server
export const REMOTE_CLIENT_INFO = {
name: process.env.CLIENT_NAME || 'CivicNexusBridge-Client',
version: '0.1.0'
};
// Default capabilities the bridge client claims to support
export const BRIDGE_CLIENT_CAPABILITIES = {
// Define based on expected LLM client needs
tools: {
listChanged: false
},
prompts: {
listChanged: false
}
};
// Token storage configuration
export const TOKEN_DIR = '.civic';
export const TOKEN_FILE = 'bridge-config.json';
//# sourceMappingURL=config.js.map