Sponsored by Deepsite.site

BRAINS OS - version MCP

Created By
groovysquirrel9 months ago
A Serverless MCP implementation using SST, React and AWS.
Content

BRAINS OS - version MCP

A modern, serverless operating system for AI systems and agents, built with SST, React, and TypeScript. This project provides a robust framework for managing Large Language Models (LLMs) and specialized AI agents through the MCP (Model Control Protocol) with a unified command system and shared operating template.

Overview

Brains MCP is designed to:

  • Manage and orchestrate AI workflows through a visual interface
  • Provide a unified command system for AI operations
  • Enable secure, scalable deployment of AI subminds
  • Support comprehensive prompt management and benchmarking
  • Maintain strict data ownership and audit capabilities

Key Features

Current Version

  • Visual flow editor for AI workflow design
  • Unified command system for AI operations
  • Secure authentication and authorization
  • Real-time workflow execution
  • Comprehensive audit logging

Coming Soon

  • Advanced prompt library with benchmarking capabilities
  • MCP (Model Control Protocol) client/server implementation
  • Enhanced state management and persistence
  • Extended model support and integration
  • Advanced templating system

Architecture

The system is built on modern cloud-native technologies:

  • Frontend: React with TypeScript and Flow-based UI
  • Backend: AWS Lambda functions
  • Authentication: AWS Cognito
  • Database: DynamoDB
  • Infrastructure: SST (Serverless Stack)

Getting Started

Prerequisites

  • Node.js (v16 or later)
  • AWS account with configured credentials
  • Git

Installation

  1. Clone the repository:

    git clone [repository-url]
    cd brains-mcp
    
  2. Install dependencies:

    npm install
    
  3. Start the development server:

    npx sst dev
    

Test Environment Setup

  1. Create your test environment file:

    cp .env.test.example .env.test
    chmod 600 .env.test  # Set secure file permissions
    
  2. Configure your test environment by editing .env.test:

    # API Configuration
    API_STAGE=dev
    API_VERSION=latest
    API_BASE_URL=https://dev-api.yoururl-in-aws-route53.com
    
    # AWS Cognito Authentication (Required)
    COGNITO_USERNAME=your_test_username@example.com
    COGNITO_PASSWORD=your_test_password
    USER_POOL_ID=us-east-1_xxxxxx
    APP_CLIENT_ID=xxxxxxxxxxxxxxxxxx
    COGNITO_REGION=us-east-1
    IDENTITY_POOL_ID=us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    API_GATEWAY_REGION=us-east-1
    
  3. Verify your test setup:

    # Run a basic test to verify configuration
    ./packages/brainsOS/test_scripts/mcp/test_tools.sh
    

Security Notes

  • Never commit .env.test to version control
  • Keep test credentials secure and rotate them regularly
  • Ensure .env.test has correct permissions (600)
  • Review test scripts for any hardcoded sensitive data
  • Use separate test credentials from production

Test Script Organization

packages/brainsOS/test_scripts/
├── mcp/                    # MCP-specific test scripts
├── resources/             # Resource API test scripts
├── services/             # Service API test scripts
└── test_utils.sh         # Common test utilities

Running Tests

  1. Individual test scripts:

    # Run specific test suite
    ./packages/brainsOS/test_scripts/mcp/test_tools.sh
    
    # Run with specific starting point
    ./packages/brainsOS/test_scripts/mcp/test_tools.sh -5  # Start from step 5
    
  2. Interactive features:

    • Press [Enter] to continue to next test
    • Press [R] to retry the last command
    • Press [Q] to quit the test suite
  3. Reviewing results:

    • ✅ indicates passed tests
    • ❌ indicates failed tests
    • ⚠️ indicates warnings or important notices

Troubleshooting

  1. Permission Issues:

    # Reset file permissions
    chmod 600 .env.test
    chmod 755 packages/brainsOS/test_scripts/*.sh
    
  2. Authentication Errors:

    • Verify Cognito credentials in .env.test
    • Check API endpoint configuration
    • Ensure AWS region settings are correct
  3. Common Issues:

    • Token expiration: Scripts handle this automatically
    • Rate limiting: Built-in delays prevent API throttling
    • Missing environment variables: Validation will catch these

Project Structure

brains-mcp/
├── packages/
│   ├── frontend/           # React-based flow editor
│   │   ├── src/
│   │   │   ├── components/
│   │   │   ├── nodes/
│   │   │   └── core/
│   │   └── ...
│   └── brainsOS/          # Core backend system
│       ├── commands/      # Command implementations
│       ├── core/         # Core services
│       ├── functions/    # API functions
│       └── utils/        # Shared utilities
├── infra/                # Infrastructure code
└── sst.config.ts        # SST configuration

Development

Local Development

npx sst dev

Deployment

npx sst deploy --stage <stage>

Contributing

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

License

[License Type] - See LICENSE file for details

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
Tavily Mcp
CursorThe AI Code Editor