Skip to main content
Glama

nrf-mcp

MCP server for Nordic nRF Connect SDK development. Provides Claude with tools to browse documentation and sample code from the nrfconnect/sdk-nrf repository.

Tools

Tool

Description

nrf_list

List files and directories at a given path (includes file sizes). Supports recursive tree view with depth (max 3)

nrf_read

Read a file's contents (.rst docs, .c/.h source, CMakeLists.txt, prj.conf, etc.). Supports startLine/endLine for partial reads. Large files (>500 KB) are streamed and auto-truncated

nrf_search

Search across the repo using GitHub code search with qualifier support. Returns context snippets and supports pagination

nrf_diff

Compare a file between two SDK versions (tags, branches, or SHAs). Returns a unified diff

nrf_kconfig

Look up a CONFIG_* symbol — finds its Kconfig definition, type, defaults, and dependencies

Search examples

# Find all uses of a symbol
DFU_TARGET_IMAGE_TYPE_ANY

# Search docs only
FOTA path:doc/nrf

# Search samples only
peripheral_hr path:samples

# Filter by file type
CONFIG_BT_PERIPHERAL extension:conf
bt_le_adv_start extension:c

Recursive directory listing

Use depth to get a full project overview in one call:

{ "path": "samples/bluetooth/central_bas", "depth": 2 }

Reading specific line ranges

When working with large files, use startLine and endLine to read just the relevant section:

{ "path": "samples/bluetooth/central_bas/src/main.c", "startLine": 1, "endLine": 50 }

Paginating search results

Search returns up to 20 results per page. Use the page parameter to fetch more:

{ "query": "bt_le_adv_start extension:c", "page": 2 }

Comparing SDK versions

See what changed in a file between releases:

{ "path": "samples/bluetooth/central_bas/src/main.c", "fromRef": "v3.0.0", "toRef": "v3.2.4" }

Kconfig symbol lookup

Look up what a prj.conf option does:

{ "symbol": "CONFIG_BT_PERIPHERAL" }

Related MCP server: GitHub MCP Server

Setup

Prerequisites

  • Node.js 18+

  • GitHub CLI (gh) authenticated — used to supply a GitHub token at runtime

Install and build

npm install
npm run build

Register with Claude Code

claude mcp add -s user nrf-mcp -- /path/to/nrf-mcp/run.sh

Register with Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "nrf-mcp": {
      "command": "/path/to/nrf-mcp/run.sh",
      "args": []
    }
  }
}

Then restart Claude Desktop.

The run.sh wrapper fetches a fresh token from gh auth token each time the server starts, so no token is ever hardcoded.

Configuration

Variable

Default

Description

NRF_SDK_REF

main (set via nrfSdkRef in package.json)

SDK version to target — any git ref (tag, branch, commit SHA)

GITHUB_TOKEN

(from gh auth token)

GitHub API token; set explicitly to bypass the gh CLI

To target a different SDK version, set the env var in the MCP registration:

claude mcp remove nrf-mcp
claude mcp add -s user -e NRF_SDK_REF=v3.2.4 nrf-mcp -- /path/to/nrf-mcp/run.sh

Rebuild after changes

npm run build

During development, use npm run watch to recompile automatically on save.

Testing

Run the end-to-end test suite (requires gh to be authenticated):

npm test

The tests spawn the server via run.sh, exercise all five tools (including recursive listing, line ranges, pagination, snippets, diff, Kconfig lookup, and error handling), and validate input error handling.

Troubleshooting

gh: command not found or empty token The run.sh script fetches a token via gh auth token. Make sure the GitHub CLI is installed and you are logged in:

gh auth login
gh auth token   # should print a token

GitHub API 401 errors nrf_search requires authentication. If the token is missing or expired, re-authenticate with gh auth login. For Claude Desktop, ensure run.sh is executable (chmod +x run.sh) — it prepends the Homebrew bin path to find gh.

GitHub rate limit exceeded Unauthenticated requests are limited to 60/hour. With a valid GITHUB_TOKEN the limit is 5 000/hour. The server automatically retries on rate-limit errors with backoff (up to 30s). Ensure gh auth token returns a token and that run.sh is being used (not node dist/index.js directly).

Tools not appearing in Claude

  • Claude Code: run claude mcp list to confirm nrf-mcp is registered, then restart the session.

  • Claude Desktop: restart the app after editing claude_desktop_config.json. Check the Desktop developer console for MCP startup errors.

Stale results Directory listings and file contents are cached in memory for 5 minutes to reduce API calls. Restart the server to clear the cache.

Wrong SDK version Confirm the active ref with echo $NRF_SDK_REF in the same shell, or check what's registered:

claude mcp list   # shows the -e env vars set at registration time

To change it, remove and re-add the registration with the new -e NRF_SDK_REF= value.

Available Tools

3 tools
nrf_listA

List the contents of a directory in the nRF Connect SDK repo (nrfconnect/sdk-nrf @ main).

Useful starting paths:

  • "doc/nrf" → Documentation root (RST files)

  • "doc/nrf/protocols" → Bluetooth, LTE, Thread, Zigbee docs

  • "doc/nrf/libraries" → Library reference docs

  • "doc/nrf/applications" → Application-level docs

  • "samples" → All sample projects

  • "samples/bluetooth" → Bluetooth LE samples

  • "samples/cellular" → LTE/cellular modem samples

  • "samples/matter" → Matter protocol samples

  • "samples/nfc" → NFC samples

  • "samples/tfm" → Trusted Firmware-M samples

  • "samples/crypto" → Cryptography samples

Returns dirs first, then files, with full paths you can pass to nrf_read.

Inputs: path (required).

nrf_readA

Read the contents of a file from the nRF Connect SDK repo (nrfconnect/sdk-nrf @ main).

Works for any text file: .rst documentation, .c/.h source, CMakeLists.txt, Kconfig, prj.conf, .yaml, README.rst, etc.

Use nrf_list to discover paths first. Examples:

  • "samples/bluetooth/central_bas/README.rst"

  • "samples/bluetooth/central_bas/src/main.c"

  • "samples/bluetooth/central_bas/CMakeLists.txt"

  • "samples/bluetooth/central_bas/prj.conf"

Inputs: path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: nrf_list for directory listing, nrf_read for file reading, and nrf_search for content searching. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tool names follow a consistent 'nrf_' prefix with descriptive verbs (list, read, search), using snake_case uniformly. This predictable pattern enhances readability and reduces confusion.

    Tool Count4/5

    Three tools are appropriate for the server's purpose of exploring the nRF Connect SDK repo, covering listing, reading, and searching. It's slightly minimal but reasonable for this focused domain, with no unnecessary tools.

    Completeness5/5

    The tool set provides complete coverage for exploring the SDK repo: listing directories, reading files, and searching content. There are no obvious gaps, as these tools enable agents to navigate and retrieve information effectively without dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that enables Claude and other compatible LLMs to interact with the GitHub API, supporting features like creating issues, retrieving repository information, listing issues, and searching repositories.
      4
      ISC
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that allows Claude and other MCP-compatible LLMs to interact with the GitHub API, supporting features like creating issues, getting repository information, listing issues, and searching repositories.
      4
      ISC
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that enables Claude to generate, search, and manage documentation for codebases using vector embeddings and semantic search, providing tools for creating user guides, technical documentation, code explanations, and architectural diagrams.
      6
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A working MCP server that connects to the real GitHub API, enabling users to manage repositories, issues, pull requests, and more through natural language in Claude Desktop.
      -