Skip to main content
Glama
MCP Security Server

MCP Security Server

by danduh

MCP Security Server

This is a Model Context Protocol (MCP) server that provides file operations, npm package management, and configuration checking capabilities.

Available Tools

File Operations

  1. count_lines_in_file - Count lines in a text file and return metadata

  2. write_to_file - Write content to a file with append/overwrite modes

  3. read_file_content - Read file content with encoding options

NPM Package Management

  1. check_outdated_packages - Check for outdated npm packages

  2. analyze_package_security - Run npm security audit

  3. check_npm_version - Check npm installation and version

Configuration Management

  1. check_npmrc_config - Check local and global .npmrc files

  2. check_npm_global_config - Check global npm configuration

  3. verify_registry_config - Verify npm registry configuration

  4. check_npm_cache - Check npm cache information

Related MCP server: MCP Filesystem Server

Installation

  1. Clone or create the project

  2. Install dependencies: npm install

  3. Build the project: npm run build

  4. Run the server: npm start or npm run dev

Usage

The server communicates via the Model Context Protocol (MCP) over stdio. It can be integrated with MCP-compatible clients.

Example Tool Usage

Count lines in a file

{
  "name": "count_lines_in_file",
  "arguments": {
    "file_path": "/path/to/file.txt"
  }
}

Check outdated packages

{
  "name": "check_outdated_packages",
  "arguments": {
    "include_dev": true
  }
}

Write to file

{
  "name": "write_to_file",
  "arguments": {
    "file_path": "/path/to/output.txt",
    "content": "Hello, World!",
    "mode": "overwrite"
  }
}

Security Features

  • Path traversal protection

  • File size limits

  • Input validation

  • Error handling

  • Safe npm command execution

Development

  • npm run dev - Run in development mode with tsx

  • npm run build - Build TypeScript to JavaScript

  • npm start - Run the built server

License

ISC

Available Tools

10 tools
analyze_package_securityB

Run npm security audit to find vulnerabilities in dependencies

Inputs: audit_level, package_path.

check_npm_cacheA

Check npm cache location and verify cache integrity

Inputs: verify_cache.

check_npm_global_configC

Check global npm configuration settings

Inputs: config_key.

check_npmrc_configC

Check local and global .npmrc configuration files

Inputs: config_path, include_global.

check_npm_versionB

Check npm version and basic installation info

Inputs: no named parameters.

check_outdated_packagesA

Check for outdated npm packages and show current vs latest versions

Inputs: include_dev, package_path.

count_lines_in_fileB

Count the number of lines in a text file and return file metadata

Inputs: file_path (required).

read_file_contentC

Read the content of a file with optional encoding

Inputs: file_path (required), encoding, max_size.

verify_registry_configC

Verify npm registry configuration and accessibility

Inputs: check_auth, registry_url.

write_to_fileB

Write content to a file with optional append mode

Inputs: content (required), file_path (required), mode, encoding.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 10 tools

    Disambiguation3/5

    Most npm tools are distinguishable by target (audit, cache, registry, outdated, version), but check_npmrc_config and check_npm_global_config clearly overlap, and the three generic file tools don't fit the security theme. An agent could easily pick the wrong config-checking tool.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (check_*, verify_*, analyze_*, read_*, write_*, count_*). Minor semantic overlap aside, the naming convention is predictable and readable.

    Tool Count4/5

    Ten tools is a reasonable count and not padded to excess. However, count_lines_in_file, write_to_file, and read_file_content appear unrelated to the security purpose, so not every tool clearly earns its place.

    Completeness3/5

    The core npm security surface is decently covered: audit, outdated packages, config, registry, cache, and version. But there are no remediation or deeper analysis actions such as npm audit fix, vulnerability details, or dependency graph inspection, and the file tools don't fill that gap.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers