Overseas access: www.kdjingpai.com
Bookmark Us

Desktop Extensions (DXT for short) is a tool developed by Anthropic to package native MCP (Model Context Protocol) servers into easy-to-install.dxtDXT is in a ZIP compressed format and contains all the MCP Server files and a single file. It allows developers to quickly integrate the MCP server into desktop applications, and users can install it with a single click without complex configuration.DXT comes in a ZIP compressed format and contains all the files for the MCP server and amanifest.jsonfile that describes the configuration and functionality of the server.Anthropic encourages developers to participate in improvements by open-sourcing the DXT specification and toolchain to promote the popularization of AI tools for desktop applications.DXT supports applications such as Claude Desktop, providing automatic updates, simple configuration, and other features that lower the barrier to use for both developers and enterprise users.

 

Function List

  • One Click Installation of MCP Server: Users can access the program by clicking on the.dxtfile to install the local MCP server, no need to manually configure the environment.
  • Generating Extension Files: Provides CLI tools that allow developers to create and package with simple commands.dxtExtended Documentation.
  • Supports multiple operating environments: Compatible with Node.js, Python and other runtimes, support macOS, Windows, Linux platform.
  • Secure Authentication Mechanism: Ensure operational security by verifying extended integrity through cryptographic hashing.
  • Automatic update function: Support for extended automatic updates to keep the server up-to-date.
  • User Configuration Management: Bymanifest.jsonDefine user configuration items such as API keys, directory access rights, etc.
  • Open Ecological Support: Open source specification and toolchain that allows developers to customize and extend the DXT format.
  • Error Handling and Logging: Provide clear error alerts and debugging logs for developers to troubleshoot problems.

Using Help

Installation process

To use DXT, developers need to install the DXT CLI tool and then create and package the extension. Below are the detailed steps:

  1. Installing Node.js
    DXT CLI depends on Node.js environment. Visit the Node.js website to download and install the latest version (Node.js >= 16.0.0 is recommended).
  2. Installing the DXT CLI
    Open a terminal and run the following command to globally install the DXT CLI tool:

    npm install -g @anthropic-ai/dxt
    
  3. Creating DXT extensions
    • Create a project folder locally, for examplemy-extensionThe
    • Go to the folder and run the following command to initialize the extension:
      dxt init my-extension
      

      The system prompts for the extension name, author information, and extension ID. if the folder has apackage.json, some of the information is automatically populated. When finished, generatemanifest.jsonDocumentation.

  4. Configuring manifest.json
    manifest.jsonis the core file of the DXT extension that defines the extension's metadata and server configuration. The following is an example:

    {
    "dxt_version": "0.1",
    "name": "My MCP Extension",
    "version": "1.0.0",
    "description": "一个简单的MCP服务器扩展",
    "server": {
    "type": "node",
    "entry_point": "server/index.js",
    "mcp_config": {
    "command": "node",
    "args": ["server/index.js"]
    }
    },
    "user_config": {
    "allowed_directories": {
    "type": "directory",
    "title": "允许访问的目录",
    "multiple": true,
    "required": true,
    "default": ["${HOME}/Desktop"]
    }
    }
    }
    
    • Field Description::
      • dxt_version: The version of the DXT specification that the extension follows.
      • namecap (a poem)version: The name and version number of the extension.
      • server: Define how the MCP server runs, e.g., using Node.js to runserver/index.jsThe
      • user_config: Define user-configurable items, such as directories that are allowed to be accessed.
  5. Writing MCP server code
    existserverfolder to createindex.jsthat implements the MCP server logic. The MCP server logic can be implemented using the@modelcontextprotocol/sdkHandling communication with AI models. A simple example is shown below:

    const { MCP } = require('@modelcontextprotocol/sdk');
    const server = new MCP();
    server.registerTool({
    name: 'search_files',
    description: '搜索指定目录中的文件',
    execute: async (params) => {
    // 实现文件搜索逻辑
    return { result: '文件列表' };
    }
    });
    server.start();
    
  6. Packaging Extension
    Once you have completed the code and configuration, run the following command to package the project as a.dxtDocumentation:

    dxt pack my-extension my-extension.dxt
    

    packaged.dxtThe file is a ZIP archive containing all files and dependencies.

  7. Verification and Signature
    • Verify the extension: rundxt verify my-extension.dxtCheck for document integrity.
    • Signature extension (optional): rundxt sign my-extension.dxtAdd signatures to extensions for added security.
  8. Installation to Claude Desktop
    • Make sure Claude Desktop is updated to the latest version (the version that supports DXT).
    • Open Claude Desktop Settings and find the "Extensions" section.
    • Click on "Install Extension" and select the.dxtfile to complete a one-click installation.

Main Functions

  • Creating extensions: Usedxt initcommand to quickly generatemanifest.jsonand follow the prompts to configure extended information.
  • Validation extensions: Rundxt validate manifest.jsonCheck that the configuration file conforms to the DXT specification.
  • Running the MCP server: After the extension has been installed, Claude Desktop will install the extension according to themanifest.jsonhit the nail on the headserverConfiguration to start the local MCP server. Users can set API keys or directory permissions through the interface.
  • Debugging and Logging: The MCP server generates logs when it runs, and developers can check the logs for tool calls or error messages.
  • Dynamic tool support: DXT supports dynamic registration of tools, such as file searches or API calls, which developers need to register in themanifest.jsonDefine the tool name and parameters in the

caveat

  • assuremanifest.jsonin the path (e.g.server/index.js) is consistent with the actual document structure.
  • All dependencies should be included in the package (node_modules) to ensure that the extension works properly in different environments.
  • Enterprise users can refer to the Anthropic Enterprise documentation for deploying DXT extensions.

application scenario

  1. Rapid distribution of MCP servers by developers
    Developers can package a complex MCP server as a.dxtfile, which is shared with the user, and the user does not need to configure the environment to use it.
  2. Enterprise Integration AI Tools
    Enterprises can develop customized DXT extensions that integrate into internal AI workflows such as data analytics or automation tasks.
  3. Education and Research
    Researchers can use DXT to create experimental MCP servers to test AI models interacting with local data.
  4. Personal productivity tools
    Users can install the DXT extension to Claude Desktop to quickly invoke file search, code generation and other functions to enhance work efficiency.

QA

  1. How are DXT extensions secured?
    DXT verifies extended integrity through cryptographic hashing to prevent tampering. The runtime uses an isolated environment with restricted server access.
  2. What platforms does DXT support?
    DXT is compatible with macOS, Windows and Linux and supports Node.js and Python runtimes.
  3. How to debug DXT extensions?
    Check the log file, or use thedxt info my-extension.dxtReview the extension information to ensure that the configuration and code are correct.
  4. Do I need to update the extension manually?
    DXT supports automatic updates, so users do not need to reinstall it manually.
  5. Does DXT work for non-Claude applications?
    Yes, DXT is an open source format, and other desktop applications that support MCP can also integrate DXT.
0Bookmarked
0kudos

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish