Skip to content
Back to skills

383 Fix 251230 1954 Mcp Management Cli B3e1e804

ASecurity

**Issue**: [#5 - 'Test Connection' runs an error](https://github.com/mrgoonie/claudekit-skills/issues/5) **Date**: 2025-12-30 **Status**: Fixed

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
businesstypescriptgonodegitdocumentation

Works with

  • cli
  • mcp

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 383-fix-251230-1954-mcp-management-cli_b3e1e804 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 383 Fix 251230 1954 Mcp Management Cli B3e1e804?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 383 Fix 251230 1954 Mcp Management Cli B3e1e804
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-383-fix-251230-1954-mcp-management-cli-b3e1e804/badge)](https://www.skillsdirectory.com/skills/tools-only-383-fix-251230-1954-mcp-management-cli-b3e1e804)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Fix Report: MCP Management CLI Errors

**Issue**: [#5 - 'Test Connection' runs an error](https://github.com/mrgoonie/claudekit-skills/issues/5)
**Date**: 2025-12-30
**Status**: Fixed

## Problems Identified

### Issue 1: Path Resolution
Config path `.claude/.mcp.json` resolved relative to `process.cwd()`, causing wrong lookup when running from `scripts/` directory.

**Before**: `~/.claude/skills/mcp-management/scripts/.claude/.mcp.json`
**Expected**: `~/.claude/.mcp.json`

### Issue 2: TypeScript Module Resolution
Using `ts-node` with ES modules caused import resolution failures.

## Fixes Applied

### 1. Path Resolution (mcp-client.ts)
- Added `import { homedir } from 'os'`
- Changed default config path from relative `.claude/.mcp.json` to absolute `~/.claude/.mcp.json`
- Config path now resolves to user's home directory by default

```typescript
async loadConfig(configPath?: string): Promise<MCPConfig> {
  const defaultPath = resolve(homedir(), '.claude', '.mcp.json');
  const fullPath = configPath ? resolve(process.cwd(), configPath) : defaultPath;
  // ...
}
```

### 2. TypeScript Configuration (tsconfig.json)
- Changed `module` from `ES2022` to `NodeNext`
- Changed `moduleResolution` from `node` to `NodeNext`

### 3. Package Configuration (package.json)
- Replaced `ts-node` with `tsx` for better ESM support
- Added npm scripts for convenience: `list-tools`, `list-prompts`, `list-resources`

### 4. Documentation (README.md)
- Updated all command examples to use `tsx` instead of `ts-node`
- Added note about automatic config path resolution

### 5. Type Fix (mcp-client.ts)
- Fixed TypeScript error with `timeout` option in `callTool` method

## Files Modified

| File | Change |
|------|--------|
| `scripts/mcp-client.ts` | Path resolution fix, type assertion |
| `scripts/tsconfig.json` | NodeNext module resolution |
| `scripts/package.json` | tsx instead of ts-node, npm scripts |
| `README.md` | Updated documentation |

## Verification

1. TypeScript compilation passes: `npx tsc --noEmit`
2. CLI resolves to `~/.claude/.mcp.json` regardless of cwd
3. Can be run from any directory: `npx tsx cli.ts list-tools`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.