feat: implement v2 3-tier architecture (mcpctl → mcplocal → mcpd)
- Rename local-proxy to mcplocal with HTTP server, LLM pipeline, mcpd discovery - Add LLM pre-processing: token estimation, filter cache, metrics, Gemini CLI + DeepSeek providers - Add mcpd auth (login/logout) and MCP proxy endpoints - Update CLI: dual URLs (mcplocalUrl/mcpdUrl), auth commands, --direct flag - Add tiered health monitoring, shell completions, e2e integration tests - 57 test files, 597 tests passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,8 @@ import { McpctlConfigSchema, DEFAULT_CONFIG } from '../../src/config/schema.js';
|
||||
describe('McpctlConfigSchema', () => {
|
||||
it('provides sensible defaults from empty object', () => {
|
||||
const config = McpctlConfigSchema.parse({});
|
||||
expect(config.daemonUrl).toBe('http://localhost:3000');
|
||||
expect(config.mcplocalUrl).toBe('http://localhost:3200');
|
||||
expect(config.mcpdUrl).toBe('http://localhost:3100');
|
||||
expect(config.registries).toEqual(['official', 'glama', 'smithery']);
|
||||
expect(config.cacheTTLMs).toBe(3_600_000);
|
||||
expect(config.outputFormat).toBe('table');
|
||||
@@ -15,7 +16,8 @@ describe('McpctlConfigSchema', () => {
|
||||
|
||||
it('validates a full config', () => {
|
||||
const config = McpctlConfigSchema.parse({
|
||||
daemonUrl: 'http://custom:4000',
|
||||
mcplocalUrl: 'http://local:3200',
|
||||
mcpdUrl: 'http://custom:4000',
|
||||
registries: ['official'],
|
||||
cacheTTLMs: 60_000,
|
||||
httpProxy: 'http://proxy:8080',
|
||||
@@ -23,11 +25,26 @@ describe('McpctlConfigSchema', () => {
|
||||
outputFormat: 'json',
|
||||
smitheryApiKey: 'sk-test',
|
||||
});
|
||||
expect(config.daemonUrl).toBe('http://custom:4000');
|
||||
expect(config.mcplocalUrl).toBe('http://local:3200');
|
||||
expect(config.mcpdUrl).toBe('http://custom:4000');
|
||||
expect(config.registries).toEqual(['official']);
|
||||
expect(config.outputFormat).toBe('json');
|
||||
});
|
||||
|
||||
it('backward compat: maps daemonUrl to mcplocalUrl', () => {
|
||||
const config = McpctlConfigSchema.parse({ daemonUrl: 'http://legacy:3000' });
|
||||
expect(config.mcplocalUrl).toBe('http://legacy:3000');
|
||||
expect(config.mcpdUrl).toBe('http://localhost:3100');
|
||||
});
|
||||
|
||||
it('mcplocalUrl takes precedence over daemonUrl', () => {
|
||||
const config = McpctlConfigSchema.parse({
|
||||
daemonUrl: 'http://legacy:3000',
|
||||
mcplocalUrl: 'http://explicit:3200',
|
||||
});
|
||||
expect(config.mcplocalUrl).toBe('http://explicit:3200');
|
||||
});
|
||||
|
||||
it('rejects invalid registry names', () => {
|
||||
expect(() => McpctlConfigSchema.parse({ registries: ['invalid'] })).toThrow();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user