@aredes.me/mcp-dadosbr
Version:
Model Context Protocol server for Brazilian public data lookup (CNPJ companies and CEP postal codes) with configurable API endpoints
32 lines • 1.06 kB
JavaScript
import { z } from "zod";
import { createMCPServer } from "../core/mcp-server.js";
import { MemoryCache } from "../core/cache.js";
import { resolveApiConfig } from "../config/index.js";
export const configSchema = z
.object({
cnpjBaseUrl: z
.string()
.url()
.describe("Custom CNPJ API base URL")
.optional(),
cepBaseUrl: z
.string()
.url()
.describe("Custom CEP API base URL")
.optional(),
authHeaders: z
.record(z.string())
.describe("Extra headers merged into outbound API requests")
.optional(),
})
.describe("Optional overrides for external API configuration");
export default function createServer({ config } = {}) {
// Resolve API configuration with overrides
const apiConfig = resolveApiConfig(config);
// Create cache with default settings
const cache = new MemoryCache(256, 60000);
// Create and return MCP server
const server = createMCPServer({ apiConfig, cache });
return server;
}
//# sourceMappingURL=smithery.js.map