File size: 2,562 Bytes
19a3093
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 🏥 NurseLex MCP Server Setup Guide

Welcome to the **NurseLex MCP Server**! This server uses the **Model Context Protocol (MCP)** to inject the entire i.AI Lex UK legislative database directly into your favorite AI Assistant (like Claude Desktop or Cursor).

When connected, your AI assistant gains three powerful real-time tools:

1. **`search_local_nursing_cache`**: Instantly retrieves the exact statutory text for 1,128 critical nursing sections (Mental Health Act, Care Act, etc.).
2. **`get_official_explanatory_note`**: Fetches the official UK Government plain English explainer for a specific Act and section.
3. **`vector_search_lex_api`**: A semantic search engine that maps clinical, plain-English scenarios (e.g., "patient lacks capacity to consent to treatment") to relevant national laws.

---

## 🛠️ Prerequisites

1. You must have **Python 3.10+** installed.
2. Install the required dependencies:
   ```bash
   pip install mcp fastmcp httpx pandas
   ```

---

## 🔌 Connecting to Claude Desktop

To let Claude Desktop use NurseLex as a knowledge tool, you need to edit your `claude_desktop_config.json` file.

### 1. Locate your Config File
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
- **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`

### 2. Add the NurseLex Server
Open the file in a text editor and add the following configuration to your `mcpServers` block. 

*Make sure to replace `/path/to/NurseLex` with the actual folder path where you downloaded the project!*

```json
{
  "mcpServers": {
    "nurselex": {
      "command": "python",
      "args": [
        "/path/to/NurseLex/mcp_server.py"
      ]
    }
  }
}
```

### 3. Restart Claude
Fully close and restart the Claude Desktop app. You should now see a 🔨 (hammer) icon in the chat bar indicating the tools are loaded!

---

## 🖱️ Connecting to Cursor IDE

If you are a Nurse Citizen Developer building applications in Cursor, you can add NurseLex to help write legally compliant code!

1. Open Cursor Settings (**Cmd + Shift + J** on Mac, **Ctrl + Shift + J** on Windows).
2. Go to the **Features** -> **MCP** section.
3. Click **+ Add New MCP Server**.
4. Set the following:
   - **Name:** `NurseLex`
   - **Type:** `command`
   - **Command:** `python /path/to/NurseLex/mcp_server.py` (Use the absolute path to your folder).
5. Click **Save** and verify the connection is green. 

You can now ask Cursor Agent: *"Write a Python function that uses NurseLex to find the legal requirements for Section 136 of the MHA."*