harshakrishnak/Camera-DB-MCP
If you are the rightful owner of Camera-DB-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
An MCP server for querying a database of CCTV camera information, providing tools to search, filter, and retrieve camera details from a dataset of 10,000 cameras stored in memory.
Camera DB MCP Server
An MCP (Model Context Protocol) server for querying a database of CCTV camera information. This server provides tools to search, filter, and retrieve camera details from a dataset of 10,000 cameras stored in memory.
Features
- 10,000 Sample Cameras: Pre-loaded with randomly generated camera data
- Rich Camera Data: Each camera includes:
- Camera ID, Name, Model
- Manufacturer
- IP Address, MAC Address
- Firmware Version
- Location, Type
- Install Date, Warranty Date
- Status (active/inactive/maintenance)
Available Tools
get_camera
Get details of a specific camera by ID.
Parameters:
cameraId(string, required): The camera ID (e.g., "CAM-000001")
search_cameras
Search cameras by various criteria with pagination support.
Parameters:
search(string, optional): Search term matching name, model, manufacturer, location, IP, or MACmanufacturer(string, optional): Filter by manufacturertype(string, optional): Filter by camera type (Dome, Bullet, PTZ, Box, Fisheye, Thermal, IP, Analog)location(string, optional): Filter by locationstatus(string, optional): Filter by status (active, inactive, maintenance)limit(number, optional): Maximum results (default: 100)offset(number, optional): Pagination offset (default: 0)
get_camera_stats
Get overall statistics about the camera database including counts by manufacturer, type, and status.
list_manufacturers
List all unique manufacturers in the database.
list_locations
List all unique locations in the database.
Installation
- Install dependencies:
npm install
- Build the project:
npm run build
Usage
Running the Server
The server runs on stdio and is designed to be used with MCP-compatible clients:
npm start
Quick Start: Choose Your Client
You can integrate this MCP server with several AI clients:
- Claude Desktop (Free, Recommended) - See Claude Desktop Setup
- Cursor IDE (Paid) - See Cursor Setup
- Windsurf IDE (Free/Paid) - See Windsurf Setup
- Custom Integration - See Custom Integration
💡 New to MCP? Start with Claude Desktop - it's free and the easiest to set up!
Connecting to Cursor
There are two ways to connect this MCP server to Cursor:
Method 1: Using Cursor's GUI (Recommended)
-
Open Cursor Settings:
- Go to
Settings→Features→MCP(or pressCmd+,on Mac /Ctrl+,on Windows/Linux, then search for "MCP")
- Go to
-
Add a New MCP Server:
- Click the
+ Add New MCP Serverbutton
- Click the
-
Configure the Server:
- Name:
Camera DB(or any name you prefer) - Type: Select
stdio - Command: Enter the full path to Node.js
- On Mac/Linux: Usually
/usr/local/bin/nodeor/usr/bin/node - On Windows: Usually
C:\Program Files\nodejs\node.exe - You can find it by running:
which node(Mac/Linux) orwhere node(Windows)
- On Mac/Linux: Usually
- Args: Enter the absolute path to the compiled server:
/Users/harshakrishnak/Projects/CameraDBMCP/dist/index.jsNote: Replace with your actual project path. Run
pwdin the project directory to get the absolute path.
- Name:
-
Save and Connect:
- Click Save
- Cursor will automatically connect to your MCP server
- You should see the server appear in the MCP servers list with a green status indicator
Method 2: Using Configuration File
If Cursor supports a configuration file, you can add this to your MCP config:
{
"mcpServers": {
"camera-db": {
"command": "node",
"args": ["/Users/harshakrishnak/Projects/CameraDBMCP/dist/index.js"]
}
}
}
Get your absolute path: Run
./get-path.shin this project directory to get the exact paths you need, or runpwdto get the project path.
Verifying the Connection
After adding the server in Cursor:
- Check the MCP Status: In Cursor's MCP settings, you should see your server listed with a green status indicator
- Test with a Query: Try asking Cursor:
- "Get camera statistics"
- "List all manufacturers"
- "Find cameras by Hikvision"
If the server is connected, Cursor will be able to query your camera database!
Alternative MCP Clients
Besides Cursor, you can integrate this MCP server with several other AI clients that support the Model Context Protocol:
1. Claude Desktop (Recommended Alternative)
Claude Desktop is Anthropic's official desktop application that supports MCP servers. It's free and provides a great way to interact with your camera database.
Installation & Setup:
-
Download Claude Desktop:
- Visit claude.ai/download
- Download and install Claude Desktop for your operating system
-
Configure MCP Server:
- The configuration file location depends on your OS:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
- The configuration file location depends on your OS:
-
Edit the Configuration File:
- Create or edit the config file (create the directory if it doesn't exist)
- Add your MCP server configuration:
{ "mcpServers": { "camera-db": { "command": "node", "args": ["/Users/harshakrishnak/Projects/CameraDBMCP/dist/index.js"], "description": "CCTV Camera Database with 10,000 cameras" } } }Important: Replace
/Users/harshakrishnak/Projects/CameraDBMCP/dist/index.jswith your absolute path. Usepwdin your project directory to get the path. -
Restart Claude Desktop:
- Close and reopen Claude Desktop
- The MCP server should automatically connect
-
Verify Connection:
- Look for "MCP servers connected" indicator in Claude Desktop
- Ask Claude: "Get camera statistics" or "List all Hikvision cameras"
2. Windsurf IDE
Windsurf is another code editor that supports MCP integration, similar to Cursor.
Setup:
- Install Windsurf: Download from codeium.com/windsurf
- Configure MCP: Similar to Cursor, use the Settings → MCP section
- Add Server: Use the same configuration as Cursor (stdio transport)
3. Custom Integration Using MCP SDK
You can build your own client or integrate with existing applications using the MCP SDK:
Using Node.js:
See example-client.js for a complete working example. Here's a quick snippet:
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
// Create transport
const transport = new StdioClientTransport({
command: 'node',
args: ['/path/to/CameraDBMCP/dist/index.js']
});
// Create client
const client = new Client({
name: 'my-camera-client',
version: '1.0.0'
}, {
capabilities: {}
});
// Connect and use
await client.connect(transport);
// Call tools
const result = await client.callTool({
name: 'get_camera_stats',
arguments: {}
});
console.log(result);
Run the example:
node example-client.js
Using Python:
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main():
# Create server parameters
server_params = StdioServerParameters(
command="node",
args=["/path/to/CameraDBMCP/dist/index.js"]
)
# Create session
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize
await session.initialize()
# Call tool
result = await session.call_tool(
"get_camera_stats",
arguments={}
)
print(result)
# Run
import asyncio
asyncio.run(main())
4. Web-Based MCP Clients
You can also create a web interface that communicates with your MCP server:
- Use the MCP SDK in a Node.js backend
- Create REST API endpoints that wrap MCP tool calls
- Build a frontend that queries your API
- This allows web-based access to your camera database
Comparison of MCP Clients
| Client | Type | Cost | Setup Difficulty | Best For |
|---|---|---|---|---|
| Claude Desktop | Desktop App | Free | Easy | General AI queries, chat interface |
| Cursor | IDE | Paid | Easy | Code-focused workflows |
| Windsurf | IDE | Free/Paid | Easy | Code-focused workflows |
| Custom SDK | Custom | Free | Medium | Custom applications, integrations |
Getting Your Server Path
To find the absolute path to your MCP server for any client:
# On Mac/Linux
cd /Users/harshakrishnak/Projects/CameraDBMCP
pwd
# Output: /Users/harshakrishnak/Projects/CameraDBMCP
# The server path would be:
# /Users/harshakrishnak/Projects/CameraDBMCP/dist/index.js
# Or use the provided script:
./get-path.sh
Troubleshooting MCP Connections
-
Server not starting:
- Ensure you've run
npm run build - Check that
dist/index.jsexists - Verify Node.js is in your PATH
- Ensure you've run
-
Path issues:
- Always use absolute paths in configuration
- On Windows, use forward slashes or escaped backslashes
- Test the server manually:
node dist/index.js
-
Permission issues:
- Ensure the server file is executable
- Check file permissions:
chmod +x dist/index.js(Mac/Linux)
-
Connection timeout:
- Verify the server starts correctly
- Check client logs for error messages
- Test with
node test-server.jsto verify server functionality
Example Queries
Once connected, you can query the camera database using natural language:
- "Find all cameras by Hikvision"
- "Show me cameras in the Parking Lot"
- "List all active cameras"
- "Get statistics about the camera database"
- "Find cameras with IP address starting with 192.168"
- "Show me PTZ cameras installed in 2024"
Development
Project Structure
CameraDBMCP/
├── src/
│ ├── index.ts # MCP server implementation
│ ├── cache.ts # In-memory cache for cameras
│ ├── dataGenerator.ts # Sample data generator
│ └── types.ts # TypeScript type definitions
├── dist/ # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md
Building
npm run build
Development Mode
Watch mode for development:
npm run dev
Data Generation
The sample data includes:
- 12 different manufacturers (Hikvision, Dahua, Axis, Bosch, Sony, etc.)
- 8 camera types (Dome, Bullet, PTZ, Box, Fisheye, Thermal, IP, Analog)
- 20 different locations
- Random IP addresses, MAC addresses, and firmware versions
- Install dates between 2020-2024
- Warranty dates 1-3 years after install date
License
MIT