Logo MCP-Insomnia

MCP-Insomnia

Cộng đồng
anggasct

MCP-Insomnia is an MCP server for creating and managing Insomnia-compatible API collections, requests, and environments.

Nhà phát hànhanggasct
Kho mãmcp-insomnia
Ngôn ngữTypeScript
Bản fork
6
Sao
26
Công cụ có sẵn
29
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MCP-Insomnia cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 29 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    26 sao và 6 bản fork từ kho mã được liên kết.

MCP-Insomnia

MCP-Insomnia is an MCP (Model Context Protocol) server that enables AI agents to create and manage API collections in Insomnia-compatible format. This server provides tools for managing collections, requests, and environments that can be exported to Insomnia.

Installation and Usage

Prerequisites

  • Node.js 18+
  • npm or yarn

There are three ways to use mcp-insomnia.

1. Run with NPX (Recommended)

You can run mcp-insomnia directly using npx without a global installation.

Configuration:

json
{
  "mcpServers": {
    "insomnia": {
      "command": "npx",
      "args": ["-y", "mcp-insomnia"]
    }
  }
}

2. Install Globally from NPM

Install the package globally using npm.

Installation:

bash
npm install -g mcp-insomnia

Configuration:

json
{
  "mcpServers": {
    "insomnia": {
      "command": "mcp-insomnia"
    }
  }
}

3. Install from Source

Clone the repository and build the project.

Installation:

bash
git clone https://github.com/anggasct/mcp-insomnia.git
cd mcp-insomnia
npm install
npm run build

Configuration:

json
{
  "mcpServers": {
    "insomnia": {
      "command": "node",
      "args": ["/path/to/mcp-insomnia/dist/index.js"]
    }
  }
}

Available Tools

Collection Management

  • create_collection - Create new collection/workspace
  • list_collections - List all collections
  • get_collection_detail - Get full details and statistics of a collection
  • export_collection - Export collection to JSON format

Folder Management

  • create_folder - Create folder within collection

Request Management

  • list_requests - List all requests, optionally filter by collection
  • get_request - Get full details of a specific request
  • create_request_in_collection - Create new request
  • update_request - Update existing request
  • delete_request - Delete request
  • execute_request - Execute an MCP-stored request and return the response (supports environment resolution, timeouts, and response size limits — see Request execution)
  • get_request_history - Get execution history of a request (up to 20 entries per request)

Import Tools

  • import_from_curl - Parse cURL command into a request
  • import_from_postman - Import Postman Collection (v2.1) JSON
  • import_from_openapi - Import OpenAPI 3.x or Swagger 2.x JSON
  • import_from_insomnia_export - Import collections from a standard Insomnia V4 export file

Utility Tools

  • generate_code_snippet - Generate a code snippet for a request. Requires requestId and target. Supported targets: c, clojure, csharp, go, http, java, javascript, kotlin, node, objc, ocaml, php, powershell, python, ruby, shell, swift. Optional client selects a library (e.g. axios for javascript, curl for shell).

Insomnia Direct Integration (NeDB)

Interact directly with the local Insomnia application database (macOS, Linux, Windows).

  • list_insomnia_projects - List all projects/teams from Insomnia
  • list_insomnia_collections - List all workspaces/collections from Insomnia
  • get_insomnia_collection - Get full details of a specific Insomnia workspace
  • get_insomnia_request - Get full details of a specific Insomnia request
  • sync_from_insomnia - Import a workspace from Insomnia to MCP
  • sync_all_from_insomnia - Import all workspaces from Insomnia to MCP
  • sync_to_insomnia - Export an MCP collection back to Insomnia
  • execute_insomnia_request - Execute a request directly from Insomnia without syncing (supports environment resolution and timeouts — see Request execution)

Environment Management

  • set_environment_variable - Set environment variable
  • get_environment_variables - Get environment variables

When executing requests, environment variables are merged in layers (later layers override earlier ones):

MCP collections (execute_request):

  1. Workspace/base environments attached to the collection
  2. Sub-environment (environmentId, if provided)
  3. Folder environments along the request's ancestor chain
  4. overrideVariables (per-call overrides)
  5. environmentVariables (legacy final override layer)

Insomnia app (execute_insomnia_request):

  1. Global environment (project level)
  2. Base environment (workspace level)
  3. Sub-environment (environmentId, if provided)
  4. Folder environments along the request's ancestor chain
  5. overrideVariables (per-call overrides)

Request execution

Both execution tools accept optional runtime parameters:

Parameterexecute_requestexecute_insomnia_requestDescription
requestId✓✓ID of the request to run
environmentId✓✓Sub-environment ID for variable substitution
overrideVariables✓✓Per-call variable overrides (e.g. {"token": "abc123"})
environmentVariables✓Legacy final override layer for MCP collections
timeoutMs✓✓Request timeout in ms (default 30000; set <= 0 for no timeout — MCP cancellation still applies)
maxResponseBytes✓Max serialized response body size in tool output; exceeded bodies are truncated to a preview

Search & Statistics

  • search - Search across all collections, folders, and requests
  • get_stats - Get global statistics of all collections

Usage Examples

Create Collection

Create a new Insomnia collection named "API Testing" for testing endpoints

Add Request

Add GET request to "API Testing" Insomnia collection with:
- Name: Get Users
- URL: https://jsonplaceholder.typicode.com/users
- Headers: Content-Type: application/json

Set Environment Variable

Set Insomnia environment variable "baseUrl" with value "https://api.example.com" for "API Testing" collection

Execute Request

Execute "Get Users" request using the configured environment variables

With optional parameters:

Execute request req_abc123 with environmentId env_xyz, timeout 15000ms, and override baseUrl to https://staging.api.example.com

Generate Code Snippet

Generate a code snippet for request req_abc123 in javascript using axios

Data Storage

Data is stored in two locations:

  1. MCP Storage: ~/.mcp-insomnia/collections.json

    • Working area for building/editing collections before syncing
    • Changes here do NOT affect the Insomnia App until synced
    • Ideal for generating new collections, importing from OpenAPI, or mass-refactoring
  2. Insomnia App Storage (NeDB)

    • The database used by Insomnia App
    • Changes here are visible in the App (may require restart)
    • Default paths:
      • macOS: ~/Library/Application Support/Insomnia
      • Linux: ~/.config/Insomnia
      • Linux (Flatpak): ~/.var/app/rest.insomnia.Insomnia/config/Insomnia
      • Windows: %APPDATA%/Insomnia

Custom Insomnia Data Directory

If Insomnia is installed in a non-default location, you can set the INSOMNIA_DATA_DIR environment variable to specify the path:

json
{
  "mcpServers": {
    "insomnia": {
      "command": "npx",
      "args": ["mcp-insomnia"],
      "env": {
        "INSOMNIA_DATA_DIR": "~/.var/app/rest.insomnia.Insomnia/config/Insomnia"
      }
    }
  }
}

Note: Flatpak installations on Linux are auto-detected — you only need INSOMNIA_DATA_DIR if your Insomnia data is in a truly custom location.

Recommended Workflow

Scenario A: Creating/Modifying Content

  1. Import/Fetch: Pull data from Insomnia (sync_from_insomnia or import_from_openapi)
  2. Edit: Modify requests/folders using MCP tools (create_request_in_collection, update_request)
  3. Publish: Sync changes back to Insomnia (sync_to_insomnia)

Scenario B: Running Existing Requests

  • Use execute_insomnia_request to run requests directly from Insomnia App without syncing

Contributing

Contributions are welcome! Bug fixes, new tools, and improvements are all appreciated.

bash
git clone https://github.com/anggasct/mcp-insomnia.git
cd mcp-insomnia
npm install
npm run build
npx @modelcontextprotocol/inspector node dist/index.js  # test via MCP Inspector

Fork the repo, create a branch from main, and open a PR. Use conventional commits (feat:, fix:, docs:, etc.).

Found a bug or have an idea? Open an issue.

License

MIT License

Changelog

See CHANGELOG.md for release history.

Cài đặt

TypingMind
{
  "mcpServers": {
    "mcp-insomnia": {
      "command": "npx",
      "args": [
        "mcp-insomnia"
      ]
    }
  }
}

Công cụ có sẵn

  • create_collection

    Create a new collection/workspace in Insomnia

  • list_collections

    List all collections and their structure

  • get_collection_detail

    Get full details and statistics of a specific collection

  • export_collection

    Export collection to JSON (Insomnia V4 format)

  • create_folder

    Create a folder to group requests within a collection

  • list_requests

    List all requests across collections. Optionally filter by collectionId.

  • get_request

    Get full details of a specific request by ID

  • get_request_history

    Get the execution history of a specific request

  • create_request_in_collection

    Create a new request within a specific collection/folder

  • update_request

    Update an existing request

  • delete_request

    Delete a request from a collection

  • execute_request

    Execute a request and get a response

  • set_environment_variable

    Set environment variables for a collection

  • get_environment_variables

    Get environment variables from a collection

  • import_from_insomnia_export

    Import collections from a standard Insomnia V4 export file

  • generate_code_snippet

    Generate a code snippet for a request in various languages/frameworks

  • import_from_curl

    Create a request from a cURL command

  • import_from_postman

    Import collections from a Postman Collection v2.1 JSON file

  • import_from_openapi

    Generate requests from OpenAPI/Swagger specification

  • list_insomnia_collections

    List all collections directly from Insomnia app (requires Insomnia to be installed)

  • list_insomnia_projects

    List all projects from Insomnia app

  • get_insomnia_collection

    Get a complete collection from Insomnia app by workspace ID

  • sync_from_insomnia

    Import a collection from Insomnia app into MCP storage

  • sync_to_insomnia

    Export a collection from MCP storage to Insomnia app

  • sync_all_from_insomnia

    Import all collections from Insomnia app into MCP storage

  • get_insomnia_request

    Get detailed request information directly from Insomnia

  • execute_insomnia_request

    Execute a request directly from Insomnia app without syncing. Supports environment variable substitution.

  • search

    Search for a keyword across all collections, folders, and requests

  • get_stats

    Get global statistics of all collections

Dùng MCP MCP-Insomnia với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MCP-Insomnia, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MCP-Insomnia làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MCP-Insomnia.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcp-insomnia": {
      "command": "npx",
      "args": [
        "-y",
        "@anggasct/mcp-insomnia"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MCP-Insomnia, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MCP-Insomnia.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MCP-Insomnia giúp tôi làm việc này không?
MCP-Insomnia
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MCP-Insomnia.

Câu hỏi thường gặp

Máy chủ MCP MCP-Insomnia dùng để làm gì?

MCP-Insomnia là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MCP-Insomnia với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MCP-Insomnia với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MCP-Insomnia với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MCP-Insomnia, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MCP-Insomnia với TypingMind?

MCP-Insomnia hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MCP-Insomnia cung cấp những công cụ nào trong TypingMind?

MCP-Insomnia cung cấp 29 công cụ MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MCP-Insomnia không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MCP-Insomnia yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇