Secure Local AI Agent MCP

Secure Local AI Agent MCP

Enables ChatGPT to securely control a Windows PC via a local agent, supporting file operations, Chrome automation, and allowlisted apps with audit logging and approval workflows.

Category
Visit Server

README

Secure Local AI Agent

Generated Project Image

Generated project setup image

This image is generated by the automation harness during repository creation so the README contains a real visual asset, not only image-generation instructions.

Architecture

Custom GPT、ChatGPT Developer Mode、Codex などから、自分の Windows PC 上の Chrome・許可フォルダ・許可アプリだけを操作するための安全重視の実行基盤です。

  • 公開ダッシュボード: https://secure-local-ai-agent.pages.dev
  • GitHub Actions: https://github.com/univcorp2-ctrl/secure-local-ai-agent/actions

重要: クラウド側だけではローカルPCを操作できません。本リポジトリのローカルエージェントを対象PCへ導入し、Cloudflare Gateway と共有鍵で接続します。任意の PowerShell / CMD 実行は公開しません。

できること

  • Playwright で専用 Chrome プロファイルを操作
  • 指定ルート配下だけファイルを読取・作成・一覧化
  • pywinauto で許可済み Windows アプリと既知 UI 要素を操作
  • Custom GPT Actions(OpenAPI)と Remote MCP の両方からタスク投入
  • Cloudflare D1 にタスク・結果・監査状態を保存
  • 危険操作を awaiting_approval に停止
  • ローカル側は外向き HTTPS ポーリングのみ。受信用ポート開放不要
  • 公開ダッシュボードから接続確認とタスク状態確認

構成

flowchart LR
  GPT[Custom GPT / ChatGPT / Codex] -->|HTTPS + Bearer| CF[Cloudflare Worker]
  CF --> D1[(D1 task queue)]
  PC[Windows Local Agent] -->|outbound poll| CF
  PC --> B[Playwright / Chrome]
  PC --> F[Allowed folders]
  PC --> W[Allowlisted Windows apps]
  PC --> L[(JSONL audit log)]

最短セットアップ

1. Cloudflare Gateway

Windows PowerShell で次を実行します。

.\scripts\Bootstrap-Cloudflare.ps1

このスクリプトは D1 作成、schema 適用、2つのSecret登録、Worker配備まで進めます。

2. Windows ローカルエージェント

管理者 PowerShell で実行します。

Set-ExecutionPolicy -Scope Process Bypass
.\scripts\Install-Agent.ps1 -GatewayUrl "https://YOUR-WORKER.workers.dev" -AgentSecret "YOUR_AGENT_SECRET"

インストーラーは C:\AI-Agent、専用 Chrome プロファイル、許可ワークスペース、Python 仮想環境、Playwright、タスクスケジューラ自動起動を準備します。

3. Custom GPT

openapi/custom-gpt-actions.yaml の servers.url を Worker URL に置換し、GPT Builder の Actions へ貼り付けます。認証は Bearer API Key、値は CONTROL_PLANE_SECRET と同じものです。

Remote MCP を使う場合は ChatGPT Developer Mode から https://YOUR-WORKER.workers.dev/mcp を追加します。

安全設計

  • 任意シェル、任意実行ファイル、資格情報読取、銀行・証券・購入・契約操作は実装していません。
  • allowed_roots 外のパス、許可外アプリ、危険 URL スキーム、ローカルネットワーク宛 URL を拒否します。
  • 送信・投稿・削除・上書き・アプリ内確定クリックは既定で承認待ちです。
  • 監査ログには秘密値を保存しません。
  • 普段用 Chrome ではなく専用プロファイルを利用します。

主要ディレクトリ

  • src/local_agent/: Windows 常駐エージェント
  • cloud/: Cloudflare Worker、D1、Remote MCP
  • dashboard/: Cloudflare Pages ダッシュボード
  • openapi/: Custom GPT Actions スキーマ
  • scripts/: Windows ワンクリック導入
  • docs/: 設計・初期設定・セキュリティ・トラブル対応

開発

python -m pip install -e ".[dev]"
pytest
ruff check .
mypy src/local_agent/models.py src/local_agent/settings.py src/local_agent/security.py src/local_agent/filesystem.py
npm --prefix cloud install
npm --prefix cloud test
npm --prefix dashboard install
npm --prefix dashboard run build

必要な Secrets

実値はリポジトリへ保存しません。

  • Cloudflare Worker: CONTROL_PLANE_SECRET, AGENT_SHARED_SECRET
  • GitHub Actions で Worker を自動配備する場合: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, CONTROL_PLANE_SECRET, AGENT_SHARED_SECRET, CLOUDFLARE_D1_DATABASE_ID

詳細は docs/setup.md、設計は docs/architecture.md、安全方針は docs/security.md を参照してください。

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured