Skip to content

kliu2python/ai-mcp-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI MCP Portal

This project provides a FastAPI backend and browser-based portal for managing Model Context Protocol (MCP) sessions. The portal includes preconfigured Chrome DevTools MCP slots backed by XPRA remote desktops and can also connect to custom MCP servers.

Prerequisites

  • Python 3.10+
  • An OpenAI-compatible API key exported as OPENAI_API_KEY
  • Optional: Override the default Chrome MCP or XPRA hosts by setting CHROME_MCP_HOST / CHROME_XPRA_HOST

Installation

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Copy .env.example to .env (or create .env) and populate the necessary values, or export them in your shell before starting the server.

cp .env.example .env  # optional helper if you maintain an example file

At minimum, the following variables are expected:

OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini        # optional, defaults to provider defaults when unset
OPENAI_BASE_URL=https://api.openai.com/v1  # optional
CHROME_MCP_HOST=10.160.13.110   # optional, defaults to 10.160.13.110
CHROME_XPRA_HOST=10.160.13.110  # optional, defaults to CHROME_MCP_HOST

Running the Portal

Start the FastAPI application with Uvicorn:

uvicorn index:app --reload --host 0.0.0.0 --port 8000

Then open http://localhost:8000 in your browser. The portal lists available MCP collections, allows creating sessions, submitting prompts, and embeds the XPRA remote desktops for active sessions.

API Endpoints

The same server exposes a JSON API that the portal consumes. Useful endpoints include:

  • GET /health – basic health check
  • GET /collections – list registered MCP collections and slots
  • POST /sessions – create a new session from a collection or custom MCP URL
  • POST /sessions/{session_id}/tasks – run a task against an active session

Refer to index.py for the complete list of routes and payload formats.

Development Tips

  • Static assets live in static/ and templates in templates/.
  • Modify ai_mcp_portal/session_manager.py to customize session allocation or integrate an alternative persistence layer.
  • Run python -m compileall . or your preferred test suite before committing changes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors