Skip to content

kodustech/kodus-mcp-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Kodus MCP Manager

Node.js TypeScript NestJS PostgreSQL Docker License

πŸ”Œ Multi-Cloud Platform Manager - A robust system for managing MCP integrations with providers like Composio.


πŸ“‹ Table of Contents


πŸ—οΈ Prerequisites

Tool Minimum Version Status Description
πŸ“Ÿ Node.js v18+ βœ… Required JavaScript runtime
🐳 Docker Latest βœ… Required For PostgreSQL
🐳 Docker Compose Latest βœ… Required Container orchestration
πŸ”‘ Composio API Key - βœ… Required For Composio integration

πŸ”Œ Providers

πŸ“Š Available Providers

Provider Status Description Documentation
🎯 Composio βœ… Active Automation and integration platform Docs
βž• New Provider πŸ”„ In Development Add your own provider Guide

πŸ”§ Composio Setup

To use the Composio provider, you need to:

  1. πŸ”‘ Create an integration for any app on the Composio platform
  2. πŸ–₯️ Set up an MCP Server for this integration
  3. πŸ“‹ Configure the required environment variables

βš™οΈ Configuration

🌍 Environment Variables

In the .env.test file at the project root:

# πŸš€ Application
NODE_ENV=development
PORT=3000

# πŸ” JWT
JWT_SECRET=your-super-secret-jwt-key

# πŸ”Œ Providers
MCP_PROVIDERS=composio

# 🎯 Composio
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_BASE_URL=https://backend.composio.dev

# πŸ—„οΈ Database
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=kodus
DB_PASSWORD=kodus123
DB_DATABASE=kodus_mcp

# πŸ”— URLs
# Used as redirect after OAuth2 login
REDIRECT_URI=http://localhost:3000/callback

πŸ—„οΈ Database Structure

πŸ“Š Schema: mcp-manager

The project uses a dedicated schema to organize all application tables:

-- Main schema
CREATE SCHEMA IF NOT EXISTS "mcp-manager";

πŸ“‹ Tables

πŸ”— mcp_connections

Main table for storing MCP connections:

Column Type Description
id UUID Primary key (uuid_generate_v4)
organizationId VARCHAR Organization ID
integrationId VARCHAR Integration ID
provider VARCHAR Provider name (e.g., composio)
status VARCHAR Connection status
appName VARCHAR Application name
mcpUrl VARCHAR MCP server URL
allowedTools JSONB List of allowed tools
metadata JSONB Additional connection data
createdAt TIMESTAMP Creation date
updatedAt TIMESTAMP Last update date
deletedAt TIMESTAMP Deletion date (soft delete)

πŸ“ migrations

TypeORM migration control table:

Column Type Description
id SERIAL Primary key
timestamp BIGINT Migration timestamp
name VARCHAR Migration name

πŸ”§ Useful Commands

# Check database structure
docker-compose exec kodus-mcp-manager psql -h db_postgres -U $API_PG_DB_USERNAME -d $API_PG_DB_DATABASE -c "\dt mcp-manager.*"

# Check connection data
docker-compose exec kodus-mcp-manager psql -h db_postgres -U $API_PG_DB_USERNAME -d $API_PG_DB_DATABASE -c "SELECT * FROM \"mcp-manager\".mcp_connections;"

# Check executed migrations
docker-compose exec kodus-mcp-manager psql -h db_postgres -U $API_PG_DB_USERNAME -d $API_PG_DB_DATABASE -c "SELECT * FROM \"mcp-manager\".migrations;"

πŸš€ Installation

πŸ“₯ 1. Clone the Repository

git clone https://github.com/kodustech/kodus-mcp-manager.git
cd kodus-mcp-manager

πŸ“¦ 2. Install Dependencies

yarn install

πŸ”₯ Running the Application

πŸ› οΈ Local Development

πŸ“‹ Prerequisites

# 🐳 Start PostgreSQL database
docker-compose up -d

# πŸ“Š Check if database is running
docker-compose ps

πŸ—„οΈ Database Setup

# πŸ”„ Run migrations (creates schema and tables automatically)
yarn migrate

# Or run steps separately:
# 1. Create schema (if needed)
yarn pre:migrate

# 2. Run migrations
yarn migration:run

πŸš€ Start Application

# πŸš€ Start in development mode
yarn start:dev

# Or use Docker
docker-compose exec kodus-mcp-manager yarn start:dev

The application will be available at: http://localhost:3101

🏭 Production

# πŸ—οΈ Build the application
yarn build

# πŸš€ Run in production
yarn start:prod

🐳 Docker (Alternative)

# πŸš€ Start everything with Docker
docker-compose up -d

# πŸ“Š Check status
docker-compose ps

# πŸ”„ Run migrations in container
docker-compose exec kodus-mcp-manager yarn migrate

πŸ“‹ Available Scripts

Command Description
yarn migrate Run complete migrations (schema + tables)
yarn pre:migrate Create schema if it doesn't exist
yarn migration:run Run TypeORM migrations
yarn migration:generate Generate new migration
yarn start:dev Start application in development mode
yarn docker:up Start Docker containers
yarn docker:down Stop Docker containers

πŸ†• Adding a New Provider

πŸ“‹ Step by Step

1️⃣ Configure Provider

# Add to .env file
MCP_PROVIDERS=composio,new_provider

2️⃣ Create Provider Class

// src/modules/providers/new_provider/new_provider.provider.ts

import { BaseProvider } from '../base.provider';

export class NewProviderProvider extends BaseProvider {
  // πŸ”§ Provider implementation

  async getIntegrations() {
    // Your logic here
  }

  async initiateConnection() {
    // Your logic here
  }

  // ... other required methods
}

3️⃣ Create Client (If Needed)

// src/clients/new_provider/index.ts

export class NewProviderClient {
  constructor(private config: any) {}

  async makeApiCall() {
    // External API calls
  }
}

4️⃣ Create Tests

// test/provider/new_provider.spec.ts

describe('NewProviderProvider', () => {
  // Your tests here
});

πŸ§ͺ Testing

# πŸ§ͺ Run all tests
yarn test

πŸ“– View complete testing documentation


πŸ“« Postman

πŸ“₯ Import Collection

  1. Open Postman
  2. Import β†’ File
  3. Select: postman/kodus-mcp-manager.postman_collection.json

πŸ”§ Configure Variables

Variable Value Description
baseUrl http://localhost:3000 API base URL
provider composio Default provider
token your-jwt-token Authentication token

🎯 Available Endpoints

  • πŸ”— Connections: List, search, update
  • πŸ”Œ Integrations: List, details, parameters, tools
  • πŸš€ Connect: Initiate connection with provider

πŸ› Troubleshooting

❌ Common Issues

πŸ”΄ "Port 3101 already in use"

# Find process on port 3101
lsof -i :3101

# Kill process
kill -9 <PID>

# Or use different port
PORT=3102 yarn start:dev

πŸ”΄ "Database connection failed"

# Check if PostgreSQL is running
docker-compose ps

# Restart database
docker-compose restart db_postgres

# Check logs
docker-compose logs db_postgres

πŸ”΄ "Migration failed - schema does not exist"

# Create schema manually
yarn pre:migrate

# Or run complete migrations
yarn migrate

πŸ”΄ "Migration failed - table already exists"

# Check executed migrations
docker-compose exec kodus-mcp-manager npm run typeorm -- migration:show

# Revert last migration if needed
yarn migration:revert

# Or reset database completely
docker-compose down -v
docker-compose up -d
yarn migrate

πŸ”΄ "Composio API Key invalid"

# Check environment variable
echo $COMPOSIO_API_KEY

# Test API key
curl -H "x-api-key: $COMPOSIO_API_KEY" https://backend.composio.dev/api/v1/auth_configs

πŸ”΄ "Script create-schema.sh failed"

# Check if database container is running
docker ps | grep db_postgres

# Check environment variables
cat .env | grep API_PG_DB

# Run script manually
./scripts/create-schema.sh

πŸ“š Useful Resources

Resource Link Description
πŸ“– NestJS Documentation nestjs.com Base framework
🎯 Composio Docs docs.composio.dev Main provider
🐳 Docker Docs docs.docker.com Containerization
πŸ“« Postman postman.com API testing

🀝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Open a Pull Request

πŸ“„ License

This project is under the MIT license. See the LICENSE file for more details.


πŸŽ‰ Kodus MCP Manager Project

[πŸš€ Deploy](yarn start:prod) [πŸ§ͺ Tests](yarn test) πŸ“« Postman

Made with ❀️ by the Kodus team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •