Skip to content

Commit

Permalink
metal mcp init
Browse files Browse the repository at this point in the history
  • Loading branch information
0xrinegade committed Jan 9, 2025
0 parents commit 045b75b
Show file tree
Hide file tree
Showing 7 changed files with 749 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Dependencies
node_modules/
package-lock.json

# Build output
build/
dist/
*.tsbuildinfo

# Environment
.env
.env.local
.env.*.local

# IDE
.vscode/
.idea/
*.swp
*.swo

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# OS
.DS_Store
Thumbs.db

# Testing
coverage/
.nyc_output/

# Cache
.npm/
.eslintcache
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Metal MCP Server

An MCP server providing Metal Framework documentation search and code generation capabilities.

## One-Line Installation

```bash
npx @modelcontextprotocol/create-server metal-mcp && cd metal-mcp && npm install && npm run build
```

## Features

### Tools

1. `search_metal_docs`
- Search Metal Framework documentation and code examples using natural language queries
- Parameters:
- `query`: Natural language query about Metal Framework
- `limit`: Maximum number of results to return (default: 3)

2. `generate_metal_code`
- Generate Metal Framework code for common tasks
- Parameters:
- `task`: Description of the Metal task to generate code for
- `language`: Programming language (objective-c, swift, or metal)

### Resources

1. `metal://docs/getting-started`
- Comprehensive guide for getting started with Metal Framework

2. `metal://docs/best-practices`
- Best practices and optimization tips for Metal Framework

## Usage

After installation, add the server to your MCP configuration:

```json
{
"mcpServers": {
"metal": {
"command": "node",
"args": ["/path/to/metal-mcp/build/index.js"]
}
}
}
```

The server will provide Metal Framework expertise through the MCP protocol, allowing you to:
- Search Metal documentation with natural language queries
- Generate code snippets for common Metal tasks
- Access Metal best practices and getting started guides
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "metal-mcp-server",
"version": "0.1.0",
"type": "module",
"scripts": {
"build": "tsc && chmod +x build/index.js",
"start": "node build/index.js",
"dev": "ts-node-esm src/index.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.1.0",
"@xenova/transformers": "^2.14.0",
"axios": "^1.6.5",
"cheerio": "^1.0.0-rc.12",
"hnswlib-node": "^2.0.0"
},
"devDependencies": {
"@types/cheerio": "^0.22.35",
"@types/node": "^20.11.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
}
}
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node
import { MetalExpertServer } from './server.js';

async function main() {
const server = new MetalExpertServer();
await server.run();
}

main().catch((error) => {
console.error('Server error:', error);
process.exit(1);
});
Loading

0 comments on commit 045b75b

Please sign in to comment.