Package Exports
- @metaengine/mcp-server
- @metaengine/mcp-server/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@metaengine/mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MetaEngine MCP Server
Generate up to 100 types at once. Claude writes files directly to disk. Zero copy-paste.
Works with Claude Code and other MCP clients. Supports 8 languages: TypeScript • Python • Go • C# • Java • Kotlin • Groovy • Scala
Why MetaEngine?
Traditional approach:
You: "Generate User, Order, Product, and OrderItem classes"
Claude: [Generates code in chat - uses 10,000+ tokens]
You: [Copy-paste into 4 separate files manually]
You: [Fix imports manually]
You: [Repeat for services, DTOs, repositories...]With MetaEngine:
You: "Generate User, Order, Product, OrderItem, and their services"
Claude: [Uses MetaEngine - generates all 8+ files directly to disk]
Result: ✓ All files created with perfect imports. Zero copy-paste.Key advantages:
- Batch generation: Up to 100 types in one call (entire CRUD API at once)
- Direct file writing: No copy-paste, no manual file creation
- Context efficiency: Saves thousands of tokens per generation
- Perfect imports: All cross-file references resolved automatically
- Related types together: Models + services + DTOs in one atomic operation
Quick Start
Install (optional - npx works too):
npm install -g @metaengine/mcp-server
Add to your MCP config (
~/.claude/mcp.jsonfor Claude Code):{ "mcpServers": { "metaengine": { "command": "npx", "args": ["-y", "@metaengine/mcp-server"] } } }
Use it:
You: "Generate a User class with id, email, and createdAt properties in TypeScript" Claude Code: [Uses MetaEngine MCP to generate perfect TypeScript code]
That's it. No API keys, no signup, no configuration.
How It Works
You (natural language)
→ Claude Code (constructs spec)
→ MCP Server (this package, local)
→ MetaEngine API (free service)
→ Generated code (written to disk)Privacy:
- Your code specs are sent to the API for generation
- Code is never saved or logged
- Generated code stays on your machine
- MCP server is open source (MIT)
What You Can Generate (In One Call)
Complete systems:
- Entire CRUD API (models + services + DTOs + repositories)
- Domain models with all relationships
- Clean architecture layers (entities + use cases + adapters)
- Full NestJS/Django/Spring Boot modules
Code features:
- Classes, interfaces, enums with full type safety
- Generic classes with constraints (
Repository<T extends BaseEntity>) - Inheritance and interface implementation
- Automatic imports and cross-file references
- Decorators/annotations (
@Injectable,[ApiController], etc.)
Workflow features:
- Direct file writing (no copy-paste needed)
- Batch generation (up to 100 types at once)
- Dry run mode (preview without writing)
- Skip existing files (incremental generation)
- Spec files (version control your patterns)
Performance:
- Instant generation - typically milliseconds even for large batches
- Saves thousands of AI tokens per generation
Pricing:
- Currently free (no API key, no signup)
- Future pricing to be determined
Examples
Note: These are JSON specs that Claude Code constructs for you based on natural language. You can also save them as
.jsonfiles and reference them.
Basic Class
// You say: "Generate a User class in TypeScript"
// Claude constructs this spec and calls the MCP:
{
"language": "typescript",
"outputPath": "./src",
"classes": [
{
"name": "User",
"typeIdentifier": "user",
"properties": [
{ "name": "id", "primitiveType": "String" },
{ "name": "email", "primitiveType": "String" },
{ "name": "createdAt", "primitiveType": "Date" }
]
}
]
}
// Result: src/user.ts
export class User {
id!: string;
email!: string;
createdAt!: Date;
}Multiple Related Types
// You say: "Create User, Order, and OrderStatus enum in TypeScript"
{
"language": "typescript",
"outputPath": "./src",
"enums": [
{
"name": "OrderStatus",
"typeIdentifier": "status",
"members": [
{ "name": "Pending", "value": 1 },
{ "name": "Shipped", "value": 2 },
{ "name": "Delivered", "value": 3 }
]
}
],
"classes": [
{
"name": "User",
"typeIdentifier": "user",
"properties": [
{ "name": "id", "primitiveType": "String" },
{ "name": "email", "primitiveType": "String" }
]
},
{
"name": "Order",
"typeIdentifier": "order",
"properties": [
{ "name": "id", "primitiveType": "String" },
{ "name": "userId", "primitiveType": "String" },
{ "name": "status", "typeIdentifier": "status" }
]
}
]
}
// Result: Generates user.ts, order.ts, order-status.enum.ts with correct importsUsing Spec Files (Recommended for Complex Patterns)
# 1. Save your architecture pattern once
cat > .specs/nestjs-crud.json << 'EOF'
{
"language": "typescript",
"outputPath": "./src",
"classes": [
{
"name": "User",
"typeIdentifier": "user",
"path": "entities",
"properties": [
{ "name": "id", "primitiveType": "String" },
{ "name": "email", "primitiveType": "String" }
]
},
{
"name": "UserService",
"typeIdentifier": "user-service",
"path": "services",
"decorators": [{ "code": "@Injectable()" }],
"customImports": [
{ "path": "@nestjs/common", "types": ["Injectable"] }
],
"customCode": [
{ "code": "async findAll(): Promise<User[]> { return []; }" }
]
}
]
}
EOF
# 2. Tell Claude Code:
"Load the NestJS CRUD spec from .specs/nestjs-crud.json"
# Claude uses: load_spec_from_file tool
# Result: Generates entities/user.ts and services/user-service.tsCore Concepts
Primitive Types
Use for built-in types: String, Number, Boolean, Date, Any
{ "name": "age", "primitiveType": "Number" }Type References
Reference other types being generated:
{ "name": "status", "typeIdentifier": "status-enum" }Properties vs CustomCode
Properties: Type declarations only
"properties": [
{ "name": "id", "primitiveType": "String" }
]
// → id!: string;CustomCode: Methods and initialized fields
"customCode": [
{ "code": "async getAll(): Promise<User[]> { return []; }" }
]
// → Exactly that codeArrays and Dictionaries
Array Types:
"arrayTypes": [
{ "typeIdentifier": "user-array", "elementTypeIdentifier": "user" }
],
"classes": [
{
"name": "Store",
"properties": [
{ "name": "users", "typeIdentifier": "user-array" }
]
}
]
// → users!: Array<User>;Dictionary Types:
"dictionaryTypes": [
{
"typeIdentifier": "user-map",
"keyPrimitiveType": "String",
"valueTypeIdentifier": "user"
}
]
// → Record<string, User> or Dictionary<string, User> or Map<String, User>Generic Classes
{
"classes": [
{
"name": "Repository",
"typeIdentifier": "repo",
"genericArguments": [
{
"name": "T",
"constraintTypeIdentifier": "base-entity",
"propertyName": "items",
"isArrayProperty": true
}
],
"customCode": [
{ "code": "add(item: T): void { this.items.push(item); }" },
{ "code": "getAll(): T[] { return this.items; }" }
]
}
],
"concreteGenericClasses": [
{
"identifier": "user-repo",
"genericClassIdentifier": "repo",
"genericArguments": [{ "typeIdentifier": "user" }]
}
]
}
// TypeScript: Repository<T extends BaseEntity>
// C#: Repository<T> where T : BaseEntity
// Python: Repository(Generic[T])Language-Specific Notes
Go
Requires packageName for multi-file projects:
{
"language": "go",
"packageName": "github.com/user/project"
}C#, Java, Kotlin, Groovy, Scala
Optional packageName for namespace/package:
{
"language": "csharp",
"packageName": "MyApp.Domain"
}Defaults: C# → "MetaEngine", Java/Kotlin/Groovy/Scala → "com.metaengine.generated"
TypeScript & Python
No special configuration needed.
API Reference
Main Structure
{
language: "typescript" | "python" | "go" | "csharp" | "java" | "kotlin" | "groovy" | "scala",
// Optional configuration
outputPath?: string, // Default: "."
packageName?: string, // Language-specific defaults
skipExisting?: boolean, // Default: true
dryRun?: boolean, // Default: false
initialize?: boolean, // Default: false (add default values)
// Type definitions (generate files)
classes?: ClassType[],
interfaces?: InterfaceType[],
enums?: EnumType[],
customFiles?: CustomFile[], // Files without class wrapper (type aliases, utils)
// Type references (no files generated)
arrayTypes?: ArrayType[],
dictionaryTypes?: DictionaryType[],
concreteGenericClasses?: ConcreteGenericClass[],
concreteGenericInterfaces?: ConcreteGenericInterface[]
}ClassType
{
name: string, // Class name
typeIdentifier: string, // Unique ID for references
path?: string, // Subdirectory (e.g., "services")
fileName?: string, // Custom filename (without extension)
isAbstract?: boolean,
baseClassTypeIdentifier?: string, // Extend another class
interfaceTypeIdentifiers?: string[], // Implement interfaces
properties?: PropertyType[],
constructorParameters?: ConstructorParameter[],
customCode?: CodeBlock[],
customImports?: Import[],
decorators?: Decorator[],
genericArguments?: GenericArgument[]
}See AI_ASSISTANT_GUIDE.md for complete reference.
Configuration Options
Dry Run
Preview without writing files:
{ "dryRun": true }Skip Existing Files
Default behavior - won't overwrite existing files:
{ "skipExisting": true } // DefaultUseful for incremental generation and referencing existing types.
Initialize
Add default values to properties:
{ "initialize": true }// Without initialize:
id!: string;
// With initialize:
id: string = "";Documentation
Comprehensive guides included in this package:
- AI_ASSISTANT_GUIDE.md - Complete reference for AI assistants
- QUICK_START.md - Quick reference and cheat sheet
- EXAMPLES.md - Real-world patterns and use cases
Find them in node_modules/@metaengine/mcp-server/ after installation.
Troubleshooting
"MetaEngine MCP Server not found"
- Restart Claude Code after adding to
mcp.json - Check
mcp.jsonsyntax is valid JSON - Try global install:
npm install -g @metaengine/mcp-server
"Error calling MetaEngine API"
- Check internet connection
- API may be temporarily down
- Check for errors in generated specs
Files not being created
- Check
outputPathis correct - Check write permissions on directory
- If
skipExisting: true, file may already exist
Generated code has errors
- Check all referenced
typeIdentifiervalues exist - Ensure related types are in the same generation call
- Check template refs are properly defined
How to Contribute
This is the open-source MCP client. The generation engine is proprietary.
You can contribute:
- Bug reports and fixes
- Documentation improvements
- Example specs and templates
- Feature requests for the MCP client
Repository: https://github.com/meta-engine/mcp
Architecture
This package is the MCP client (local, open source).
It communicates with the MetaEngine API (hosted, free, proprietary) which contains the code generation engine.
Your code specifications are sent to the API for generation but are never saved or logged. Generated code is returned to your machine and written locally.
Pricing
Currently free with no API key required.
Future pricing models (if any) will be announced with advance notice.
License
MIT - See LICENSE file
MetaEngine - Built for developers who value quality, privacy, and simplicity.