Publishing the AI Expert Workflow MCP
April 29, 2025 ยท View on GitHub
This guide explains how to clone, build, and publish the AI Expert Workflow MCP from the GitHub repository.
Note: AI Expert Workflow is designed to work completely standalone. It can generate comprehensive PRDs without requiring Task Master or any other dependencies.
Prerequisites
- Node.js (v16+)
- npm (v7+)
- OpenRouter API key (get one from https://openrouter.ai/keys)
- GitHub account (for forking/publishing)
- npm account (for publishing to npm registry)
Step 1: Clone the Repository
Clone the existing repository:
git clone https://github.com/bacoco/ai-expert-workflow-mcp.git
cd ai-expert-workflow-mcp
Step 2: Install Dependencies
Install all required dependencies:
npm install
Step 3: Configure Environment Variables
Create a .env file based on the example:
cp .env.example .env
Edit the .env file and add your OpenRouter API key:
# OpenRouter configuration
# IMPORTANT: Replace this with your own API key from https://openrouter.ai/keys
OPENROUTER_API_KEY=your_openrouter_api_key_here
# Model settings
OPENROUTER_MODEL=tngtech/deepseek-r1t-chimera:free
MAX_TOKENS=4000
TEMPERATURE=0.7
Step 4: Build and Test Locally
Build the project:
npm run build
Run the essential tests to verify your setup:
npm run test:essential
This will test both the MCP server and the OpenRouter API integration.
You can also run individual tests:
# Test only the MCP server
npm run test:mcp-only
# Test only the OpenRouter API
npm run test:openrouter-direct
# Run comprehensive tests
npm run test:all
Test the MCP server locally:
npm start
You can also run the development server with auto-reloading:
npm run dev
Step 5: Customize (Optional)
If you want to customize the MCP before publishing:
Add New Expert Roles
- Create a new expert file in
src/experts/(follow existing patterns) - Add the new expert to
src/experts/index.ts - Create a template file in
templates/
Modify Prompts
Edit the systemPrompt in the expert files to customize how each expert responds.
Update Templates
Modify the template files in the templates/ directory to change the output document structure.
Step 6: Update Package Information
Before publishing, update the package.json file:
-
Change the package name if you're creating a fork:
"name": "your-custom-name-ai-expert-workflow-mcp", -
Update the version number if making changes to an existing package:
"version": "1.0.1", -
Update author and repository information:
"author": "Your Name", "repository": { "type": "git", "url": "git+https://github.com/yourusername/your-repo-name.git" },
Step 7: Publish to npm
Make sure you're logged in to npm:
npm login
Build the package:
npm run build
Publish to the npm registry:
npm publish
If you're publishing a scoped package (e.g., @yourusername/ai-expert-workflow-mcp):
npm publish --access public
Step 8: Use Your Published MCP
After publishing, users can install your MCP with:
npm install -g your-package-name
And configure it in their Cursor settings.
Updating Your Published MCP
- Make your changes to the codebase
- Update the version in
package.json(following semantic versioning) - Build the project:
npm run build - Publish the update:
npm publish
Publishing to GitHub Packages (Alternative)
You can also publish to GitHub Packages instead of or in addition to npm:
-
Update the
package.jsonto use your GitHub username:"name": "@yourusername/ai-expert-workflow-mcp", -
Create a
.npmrcfile:@yourusername:registry=https://npm.pkg.github.com -
Generate a GitHub token with the appropriate permissions
-
Log in to GitHub Packages:
npm login --registry=https://npm.pkg.github.com -
Publish:
npm publish
Using Your MCP in Development
During development, you can link your local version:
# In the MCP project directory
npm link
# In a project where you want to use the MCP
npm link ai-expert-workflow-mcp
This allows you to test changes without publishing.