fix
This commit is contained in:
112
README.md
112
README.md
@@ -107,24 +107,62 @@ ENABLE_DETAILED_ERRORS=false
|
||||
|
||||
### Starting the Server
|
||||
|
||||
The server supports three transport modes:
|
||||
|
||||
**1. Both Modes (Recommended - stdio + HTTP simultaneously):**
|
||||
|
||||
```bash
|
||||
# MCP Server only (stdio protocol)
|
||||
# Default mode - both transports running simultaneously
|
||||
npm start
|
||||
|
||||
# HTTP Server (full features with MCP tools)
|
||||
npm run start
|
||||
|
||||
|
||||
# Both MCP and HTTP servers simultaneously
|
||||
npm run start
|
||||
# Explicitly set both modes
|
||||
npm run start:both
|
||||
|
||||
# Development mode with auto-restart
|
||||
npm run dev:both
|
||||
```
|
||||
|
||||
### Server URLs
|
||||
**2. Stdio Mode Only (for MCP clients like Claude Desktop):**
|
||||
|
||||
When running the HTTP server, you can access:
|
||||
```bash
|
||||
# Stdio transport only
|
||||
npm run start:stdio
|
||||
|
||||
# Development mode with auto-restart
|
||||
npm run dev:stdio
|
||||
```
|
||||
|
||||
**3. HTTP Mode Only (for web-based clients):**
|
||||
|
||||
```bash
|
||||
# HTTP transport only
|
||||
npm run start:http
|
||||
|
||||
# Development mode with auto-restart
|
||||
npm run dev:http
|
||||
```
|
||||
|
||||
### Transport Configuration
|
||||
|
||||
Set the transport mode in your `.env` file:
|
||||
|
||||
```bash
|
||||
# For both MCP clients and HTTP/web clients (recommended)
|
||||
MCP_TRANSPORT=both
|
||||
|
||||
# For MCP clients only (Claude Desktop, VS Code MCP extensions)
|
||||
MCP_TRANSPORT=stdio
|
||||
|
||||
# For HTTP/web clients only
|
||||
MCP_TRANSPORT=http
|
||||
```
|
||||
|
||||
### Server URLs (HTTP Mode)
|
||||
|
||||
When running in HTTP mode, you can access:
|
||||
|
||||
- **Health Check**: `http://localhost:3000/health`
|
||||
- **MCP Protocol**: `POST http://localhost:3000/mcp` (JSON-RPC 2.0)
|
||||
- **Tools List**: `http://localhost:3000/tools`
|
||||
- **Server Stats**: `http://localhost:3000/stats`
|
||||
- **Tool Execution**: `POST http://localhost:3000/tools/{toolName}/execute`
|
||||
@@ -132,6 +170,62 @@ When running the HTTP server, you can access:
|
||||
|
||||
### Using with MCP Clients
|
||||
|
||||
**Claude Desktop Configuration:**
|
||||
|
||||
Add to your Claude Desktop configuration file:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"laravel-healthcare": {
|
||||
"command": "node",
|
||||
"args": ["/path/to/laravel-healthcare-mcp-server/index.js"],
|
||||
"env": {
|
||||
"LARAVEL_API_BASE_URL": "https://your-api.com",
|
||||
"MCP_TRANSPORT": "stdio"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**VS Code MCP Extension:**
|
||||
|
||||
Configure the MCP extension to use:
|
||||
|
||||
- **Command**: `node`
|
||||
- **Args**: `["/path/to/laravel-healthcare-mcp-server/index.js"]`
|
||||
- **Environment**: Set `MCP_TRANSPORT=stdio`
|
||||
|
||||
### MCP Protocol Testing
|
||||
|
||||
**Test tool listing:**
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:3000/mcp \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
|
||||
```
|
||||
|
||||
**Test tool execution:**
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:3000/mcp \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "tools/call",
|
||||
"params": {
|
||||
"name": "public_manage_login",
|
||||
"arguments": {
|
||||
"email": "test@example.com",
|
||||
"password": "password"
|
||||
}
|
||||
},
|
||||
"id": 2
|
||||
}'
|
||||
```
|
||||
|
||||
The server implements the Model Context Protocol and can be used with any MCP-compatible client:
|
||||
|
||||
```json
|
||||
|
Reference in New Issue
Block a user