=== NEW SERVERS ADDED (7) === - servers/closebot — 119 tools, 14 modules, 4,656 lines TS (Stage 7) - servers/google-console — Google Search Console MCP (Stage 7) - servers/meta-ads — Meta/Facebook Ads MCP (Stage 8) - servers/twilio — Twilio communications MCP (Stage 8) - servers/competitor-research — Competitive intel MCP (Stage 6) - servers/n8n-apps — n8n workflow MCP apps (Stage 6) - servers/reonomy — Commercial real estate MCP (Stage 1) === FACTORY INFRASTRUCTURE ADDED === - infra/factory-tools — mcp-jest, mcp-validator, mcp-add, MCP Inspector - 60 test configs, 702 auto-generated test cases - All 30 servers score 100/100 protocol compliance - infra/command-center — Pipeline state, operator playbook, dashboard config - infra/factory-reviews — Automated eval reports === DOCS ADDED === - docs/MCP-FACTORY.md — Factory overview - docs/reports/ — 5 pipeline evaluation reports - docs/research/ — Browser MCP research === RULES ESTABLISHED === - CONTRIBUTING.md — All MCP work MUST go in this repo - README.md — Full inventory of 37 servers + infra docs - .gitignore — Updated for Python venvs TOTAL: 37 MCP servers + full factory pipeline in one repo. This is now the single source of truth for all MCP work.
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
/**
|
|
* Authentication manager
|
|
* Automatically selects between OAuth and Service Account based on environment
|
|
*/
|
|
|
|
import type { OAuth2Client } from 'google-auth-library';
|
|
import type { JWT } from 'google-auth-library';
|
|
import { getOAuthClient, loadOAuthConfig } from './oauth.js';
|
|
import { getServiceAccountClient, loadServiceAccountConfig } from './service-account.js';
|
|
|
|
export type AuthClient = OAuth2Client | JWT;
|
|
|
|
/**
|
|
* Get authenticated client, automatically choosing auth method
|
|
* Priority: OAuth > Service Account
|
|
*/
|
|
export async function getAuthClient(): Promise<AuthClient> {
|
|
// Try OAuth first (better for interactive use)
|
|
const oauthConfig = loadOAuthConfig();
|
|
if (oauthConfig) {
|
|
console.error('Using OAuth 2.0 authentication');
|
|
return await getOAuthClient();
|
|
}
|
|
|
|
// Fall back to service account
|
|
const serviceAccountConfig = loadServiceAccountConfig();
|
|
if (serviceAccountConfig) {
|
|
console.error('Using Service Account authentication');
|
|
return getServiceAccountClient();
|
|
}
|
|
|
|
// No auth configured
|
|
throw new Error(`
|
|
No authentication configured. Please set one of:
|
|
- OAuth: GSC_OAUTH_CLIENT_ID + GSC_OAUTH_CLIENT_SECRET
|
|
- OAuth file: GSC_OAUTH_CLIENT_FILE=/path/to/client_secrets.json
|
|
- Service Account: GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
|
|
- Service Account key: GSC_SERVICE_ACCOUNT_KEY=base64encodedkey
|
|
`.trim());
|
|
}
|
|
|
|
export { getOAuthClient } from './oauth.js';
|
|
export { getServiceAccountClient } from './service-account.js';
|