=== 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.
5.8 KiB
TypeScript Compilation Fixes - Progress Report
✅ COMPLETED
1. Core Infrastructure
- ✅ Fixed
src/tools/analytics.ts- Converted all 8 tools fromserver.tool()toregistry.registerTool()pattern - ✅ Fixed
src/tools/audiences.ts- Converted first tool (need to complete remaining 6 tools) - ✅ Fixed
src/tools/ad-sets.ts- Fixed TS2352 type conversion error - ✅ Fixed
src/index.ts- Removed unused SimpleCache import
2. Pattern Established
The working pattern for tier-2 modules (analytics, audiences, budget, catalog, competitive, experiments, leads):
Before:
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
interface MetaApiClient { ... }
export function register(server: McpServer, client: MetaApiClient): void {
const toolAnnotations: ToolAnnotations = { ... };
server.tool(
"tool_name",
"description",
{ schema },
async (params) => {
// ...
return { data };
},
toolAnnotations
);
}
After:
import type { ToolRegistry } from "../server.js";
export function registerXxxTools(registry: ToolRegistry): void {
const client = registry.getClient();
registry.registerTool({
name: "tool_name",
description: "description",
inputSchema: z.object({ schema }),
annotations: { ... },
handler: async (args) => {
const params = args as { types };
// ...
const result = { data };
return {
content: [{
type: 'text',
text: JSON.stringify(result, null, 2),
}],
};
},
});
}
🔧 REMAINING WORK
Tier-2 Modules (Need Same Pattern as Analytics)
5 files remaining - Each needs full conversion:
-
✅
src/tools/analytics.ts- DONE (8/8 tools converted) -
🔄
src/tools/audiences.ts- PARTIAL (1/7 tools converted)- ✅ list_audiences
- ❌ create_custom_audience
- ❌ create_lookalike_audience
- ❌ get_targeting_reach
- ❌ suggest_interests
- ❌ search_targeting
- ❌ calculate_audience_overlap
-
❌
src/tools/budget.ts- 5 tools to convert -
❌
src/tools/catalog.ts- 4 tools to convert -
❌
src/tools/competitive.ts- 3 tools to convert -
❌
src/tools/experiments.ts- 3 tools to convert -
❌
src/tools/leads.ts- 3 tools to convert
Steps for each file:
- Replace imports: Remove
McpServer,interface MetaApiClient, andToolAnnotations - Add:
import type { ToolRegistry } from "../server.js"; - Change function signature:
export function registerXxxTools(registry: ToolRegistry) - Add at function start:
const client = registry.getClient(); - For each tool: Convert
server.tool()structure toregistry.registerTool()structure - Add type annotations to all handler parameters
- Wrap return values in
{ content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } - Cast client method params:
client.get(..., params as Record<string, unknown>)
Apps Folder (Different Issues)
10 app files with TS2347, TS7006, TS6133, TS2339 errors:
TS2347: "Untyped function calls may not accept type arguments"
These are in apps that import and call client methods with generic type arguments. Fix: The apps need to properly type the client parameter or import the MetaApiClient type.
Example files:
src/apps/ab-test-results.ts(lines 45, 56)src/apps/account-health.ts(lines 42, 48, 55, 62, 73)src/apps/ad-library-browser.ts(line 64)src/apps/ad-performance-grid.ts(lines 44, 51)src/apps/audience-builder.ts(line 49)src/apps/campaign-dashboard.ts(lines 43, 50)src/apps/creative-preview.ts(lines 41, 53)src/apps/funnel-analyzer.ts(line 47)src/apps/performance-heatmap.ts(line 48)src/apps/spend-tracker.ts(lines 47, 56)
Fix pattern:
Check app function signature - if client parameter is typed as any, change to:
import type { MetaApiClient } from '../client/meta-client.js';
export async function myApp(client: MetaApiClient, ...otherParams) {
// Now client.get<Type>() will work
}
TS7006: "Parameter implicitly has 'any' type"
Add explicit types to all callback parameters.
Fix:
// Before
.map((item) => ...)
.filter((x) => ...)
// After
.map((item: ItemType) => ...)
.filter((x: XType) => ...)
TS6133: "declared but its value is never read"
Remove or use the unused variables.
Examples:
src/apps/ab-test-results.ts:54- Removeindexparametersrc/apps/account-health.ts:81- Remove or usepreviousDatasrc/apps/account-health.ts:123- Remove or usecurrentCPAsrc/apps/campaign-builder.ts:43- Remove unusedclientparametersrc/apps/spend-tracker.ts:53- Remove or useamountSpent
TS2339: Property does not exist
These are type narrowing issues where TypeScript doesn't know which union type variant you're using.
Files:
src/apps/ab-test-results.ts- PropertiesconfidenceandroasLiftdon't exist on base type- Fix: Add type guard or use optional chaining:
result.confidence ?? 0
- Fix: Add type guard or use optional chaining:
📊 Current Error Count
Total errors: ~140
- Tier-2 modules: ~60 errors (5 files)
- Apps folder: ~80 errors (10 files)
🎯 Recommended Next Steps
- Complete tier-2 modules - These follow a consistent pattern and can be batch-processed
- Fix app client typing - Add proper MetaApiClient types to all app functions
- Add callback parameter types - Go through each TS7006 error and add types
- Clean up unused variables - Remove or use all TS6133 flagged variables
- Fix property access issues - Handle union types properly in ab-test-results.ts
🛠 Quick Fix Commands
# Check remaining error count
npx tsc --noEmit 2>&1 | wc -l
# See errors by file
npx tsc --noEmit 2>&1 | grep "^src/" | cut -d'(' -f1 | sort | uniq -c | sort -rn
# Test specific file
npx tsc --noEmit src/tools/audiences.ts 2>&1