Pref Editor (Android) MCP server

Integrates with Android devices through ADB connectivity to read, modify, add, and delete SharedPreferences and DataStore preference files for debugging app preferences, automating testing workflows, and managing app configuration data.
Back to servers
Setup instructions
Provider
Charles Muchene
Release date
Apr 25, 2025
Stats
2 stars

The Android Preference Editor MCP Server enables natural language control of Android app preferences in real-time. This tool lets you edit, add, delete, and read preference values through simple conversational commands without manual file editing, making Android development workflows more efficient.

Installation

The server requires:

  • Android ADB (v1.0.41+)
  • Node.js 14+ or Docker

You can install and configure the server using either Docker or npx, depending on your environment.

Docker Installation

Pull and run the Docker image:

docker run -i --rm charlesmuchene/pref-editor-mcp-server

NPX Installation

Install and run using npx:

npx -y @charlesmuchene/pref-editor-mcp-server

Integration with Development Environments

Android Studio Integration

To integrate with Android Studio (assuming you have an MCP-compatible client installed), update your MCP server configuration file.

For GitHub Copilot IntelliJ Plugin, edit ~/.config/github-copilot/intellij/mcp.json:

Using Docker:

{
  "servers": {
    "pref-editor": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "charlesmuchene/pref-editor-mcp-server"]
    }
  }
}

Using npx:

{
  "servers": {
    "pref-editor": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@charlesmuchene/pref-editor-mcp-server"]
    }
  }
}

Claude Desktop Integration

Add this server to the Claude Desktop configuration file located at /Users/<username>/Library/Application Support/Claude/claude_desktop_config.json:

Using Docker:

{
  "mcpServers": {
    "pref-editor": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "charlesmuchene/pref-editor-mcp-server"]
    }
  }
}

Using npx:

{
  "mcpServers": {
    "pref-editor": {
      "command": "npx",
      "args": ["-y", "@charlesmuchene/pref-editor-mcp-server"]
    }
  }
}

For troubleshooting, you can view the logs:

tail -f ~/Library/Logs/Claude/mcp-server-pref-editor.log

VS Code Integration

Configure the server in VS Code using either a workspace-specific or global configuration:

In .vscode/mcp.json:

{
  "servers": {
    "pref-editor": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@charlesmuchene/pref-editor-mcp-server"]
    }
  }
}

Or in ~/Library/Application Support/Code/User/settings.json:

{
  "mcp": {
    "pref-editor": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@charlesmuchene/pref-editor-mcp-server"]
    }
  }
}

Available Tools

The server provides several tools for managing Android preferences:

Tool Description
change_preference Changes the value of an existing preference
delete_preference Delete an existing preference
add_preference Adds a new preference given the name, value, and type
read_preferences Reads all user preferences in a file
devices Lists connected Android devices
list_apps Lists apps installed on the device
list_files Lists preference files for an app

Usage Examples

Here are some examples of how to use the server with natural language commands:

  • "Toggle the isVisited user preference"
  • "Turn off the onboarding guide"
  • "List all the user preference values"
  • "Create a timestamp preference with the current epoch time"
  • "Show me all connected Android devices"
  • "List all apps installed on my device"
  • "Display preference files for the com.example.myapp application"

Testing

For debugging and testing, you can use the MCP Inspector:

npx @modelcontextprotocol/inspector npm run start

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "pref-editor" '{"command":"npx","args":["-y","@charlesmuchene/pref-editor-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "pref-editor": {
            "command": "npx",
            "args": [
                "-y",
                "@charlesmuchene/pref-editor-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "pref-editor": {
            "command": "npx",
            "args": [
                "-y",
                "@charlesmuchene/pref-editor-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later