Skip to main content

Overview

The Model Context Protocol (MCP) enables NikCLI to connect with external services, tools, and data sources through standardized interfaces. This creates a rich ecosystem of integrations while maintaining security and performance.

Server Management

Connect and manage MCP servers seamlessly

Tool Integration

Access external tools and services through MCP

Data Sources

Connect to databases, APIs, and file systems

Custom Protocols

Build and deploy custom MCP implementations

MCP Server Commands

/mcp - MCP Management

  • Server Operations
  • Server Configuration
  • Tool Access
# List available MCP servers
/mcp list
/mcp servers --status --health

# Connect to MCP server
/mcp connect filesystem
/mcp connect --server database --config ./db.json

# Disconnect from server
/mcp disconnect filesystem
/mcp disconnect --all

Built-in MCP Integrations

# File system operations
/mcp connect filesystem --root-path "/project"

# Available tools:
# - read_file: Read file contents
# - write_file: Write file contents  
# - list_files: List directory contents
# - create_directory: Create directories
# - delete_file: Delete files safely
# Database connectivity
/mcp connect database --type postgresql --config db.json

# Available tools:
# - query: Execute SELECT queries
# - schema: Get table schema information
# - describe: Describe table structure
# - explain: Explain query execution plan
# Web service integration
/mcp connect web --base-url "https://api.example.com"

# Available tools:
# - http_get: Make GET requests
# - http_post: Make POST requests
# - web_search: Search web content
# - scrape_page: Extract page content

Advanced MCP Features

Custom MCP Server Development

  • Server Implementation
  • Server Deployment
// Custom MCP server example
import { Server } from '@modelcontextprotocol/server';

const server = new Server({
  name: 'custom-server',
  version: '1.0.0'
});

server.tool('custom_tool', {
  description: 'Custom tool implementation',
  parameters: {
    type: 'object',
    properties: {
      input: { type: 'string' }
    }
  }
}, async ({ input }) => {
  // Tool implementation
  return { result: `Processed: ${input}` };
});

Security and Access Control

# Configure MCP authentication
/mcp auth --server database --method oauth2
/mcp auth --server api --token "bearer-token"

# Manage credentials securely
/mcp credentials --store --encrypt
/mcp credentials --rotate --server database
# Configure access policies
/mcp policy --server filesystem --allow-read "/safe/path/"
/mcp policy --server database --deny-write "sensitive_table"

# Audit MCP access
/mcp audit --log-level detailed --retention 90d

Integration Examples

Database Integration

# Connect to PostgreSQL
/mcp connect database --type postgresql --config "{
  \"host\": \"localhost\",
  \"port\": 5432,
  \"database\": \"myapp\",
  \"username\": \"user\"
}"

# Query database through agents
/agent backend-agent "analyze user table structure using database MCP"

File System Integration

# Enable file system access
/mcp connect filesystem --root-path "./src"

# Agent can now access files directly
/agent react-expert "refactor components using filesystem MCP to read current implementations"

API Integration

# Connect to REST API
/mcp connect web --base-url "https://api.github.com" --auth "token ghp_xxx"

# Integrate with development workflow
/agent devops-agent "check GitHub API for recent commits using web MCP"

Next Steps

MCP servers extend NikCLI’s capabilities significantly. Start with built-in servers like filesystem and database, then explore custom implementations for your specific use cases.