mcp-testing-nfc
v1.0.9
Published
This is mcp tester
Readme
MCP Compass NFC Server
A Model Context Protocol (MCP) server implementation for NFC-related operations with sample client.
Features
- MCP Server: Implements tools for user management and NFC operations
- Sample Client: Demonstrates how to connect to and interact with the MCP server
- TypeScript Support: Full TypeScript implementation with proper type definitions
Available Tools
- get_all_user: Get all user data from the database
- Owner Name: Get the owner name information
- get_single_user: Get a single user by email address
Installation
npm installBuilding
npm run buildRunning the Server
npm startRunning the Sample Client
Basic Demo Mode
Runs all sample tool calls automatically:
npm run clientInteractive Mode
Allows you to interactively test tools:
npm run client:interactiveIn interactive mode, you can use these commands:
list- List all available toolscall <tool_name> [args]- Call a tool with argumentshelp- Show help messageexit- Exit interactive mode
Example Interactive Usage
> list
Available tools:
1. get_all_user
Description: Get all user data on database
Input Schema: {"type":"object","properties":{}}
2. Owner Name
Description: This is owner name
Input Schema: {"type":"object","properties":{}}
3. get_single_user
Description: Get single user by email
Input Schema: {"type":"object","properties":{"email":{"type":"string","description":"E-mail user for query"}},"required":["email"]}
> call get_single_user {"email": "[email protected]"}
🔧 Calling tool: get_single_user
Arguments: {"email": "[email protected]"}
✅ Tool response:
Response 1:
Hello
> exit
👋 Goodbye!Development
For development with auto-reload:
npm run devProject Structure
├── src/ # TypeScript source files
│ ├── config/ # Database configuration
│ ├── model/ # Data models
│ └── index.ts # Main server file
├── build/ # Compiled JavaScript files
├── sample-client-mcp.js # Sample MCP client
└── package.json # Project configurationMCP Client Features
The sample client (sample-client-mcp.js) demonstrates:
- Connection Management: How to connect to an MCP server
- Tool Discovery: How to list available tools
- Tool Execution: How to call tools with different arguments
- Error Handling: Proper error handling and cleanup
- Interactive Mode: Command-line interface for testing
- Resource Cleanup: Proper cleanup of connections and processes
Environment Variables
Create a .env file in the root directory with your database configuration:
MONGODB_URI=mongodb://localhost:27017/your-databaseLicense
ISC
Author
Laskar Ksatria Satika
