@pagopa/dx-mcpserver 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +49 -22
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -4,17 +4,6 @@
4
4
 
5
5
  This package contains the implementation of a Model Context Protocol (MCP) server.
6
6
 
7
- ## Architecture
8
-
9
- The architecture allows any Model Context Protocol (MCP) compliant client (such as GitHub Copilot) to query the [PagoPA DX technical documentation](https://dx.pagopa.it/) in natural language, receiving contextualized and up-to-date answers.
10
-
11
- 1. **Content Upload**: On each release of the documentation website, Markdown and text files (`.md`, `.txt`) are uploaded to an S3 bucket.
12
- 2. **Indexing**: From there, the documents are processed by **Amazon Bedrock Knowledge Bases**, which handles the embedding and semantic indexing process.
13
- 3. **Vector Storage**: The resulting embeddings are saved in a Vector Bucket (an S3-based vector database), enabling efficient and persistent semantic search.
14
- 4. **Query and Retrieval**: When an MCP client sends a query, an **AWS Lambda** function implementing the MCP Server queries the Knowledge Base to retrieve the most relevant content and returns the response to the client.
15
-
16
- This approach allows AI agents like Copilot to access the documentation context in a structured way, keeping the orchestration, storage, and semantic retrieval layers separate.
17
-
18
7
  ## Features
19
8
 
20
9
  The server currently exposes the following capabilities:
@@ -25,16 +14,25 @@ The server currently exposes the following capabilities:
25
14
  - **Prompts**:
26
15
  - `GenerateTerraformConfiguration`: Guides the generation of Terraform configurations following PagoPA DX best practices.
27
16
 
28
- ## How to use it
17
+ ## Authentication
18
+
19
+ The server requires a fine-grained [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens) for authentication with the following settings:
20
+
21
+ - **Resource owner:**
22
+ - Choose the **pagopa** organization
23
+ - **Repository access:**
24
+ - Public Repositories (read-only)
25
+ - **Organization permissions:**
26
+ - Members: Read-only (to verify membership in the pagopa organization)
27
+
28
+ ## Usage
29
29
 
30
30
  This server can be used by any MCP-compliant client.
31
31
 
32
- <details>
33
- <summary><b>VS Code</b></summary>
32
+ ### VS Code
34
33
 
35
34
  Update your configuration file with the following. See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.
36
-
37
- #### VS Code Remote Server Connection
35
+ The GH PAT authentication is done via a prompt, so you will be asked to enter it the first time you use the server.
38
36
 
39
37
  ```json
40
38
  {
@@ -43,17 +41,23 @@ Update your configuration file with the following. See [VS Code MCP docs](https:
43
41
  "url": "https://api.dev.dx.pagopa.it/mcp",
44
42
  "type": "http",
45
43
  "headers": {
46
- "x-gh-pat": "${env:GH_PAT}"
44
+ "x-gh-pat": "${input:github_mcp_pat}"
47
45
  }
48
- }
46
+ },
47
+ "inputs": [
48
+ {
49
+ "type": "promptString",
50
+ "id": "github_mcp_pat",
51
+ "description": "GitHub Personal Access Token",
52
+ "password": true
53
+ }
54
+ ]
49
55
  }
50
56
  }
51
57
  ```
52
58
 
53
- </details>
59
+ ### GitHub Copilot Coding Agent
54
60
 
55
- <details>
56
- <summary><b>GitHub Copilot Coding Agent</b></summary>
57
61
  You need to configure it in the repository settings. See [GitHub Copilot MCP docs](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/extend-coding-agent-with-mcp) for more info.
58
62
 
59
63
  1. **Declare the MCP Server**: In the "Copilot" >> "Coding agent" panel of your repository settings, add an MCP Server declaration as follows:
@@ -77,7 +81,19 @@ You need to configure it in the repository settings. See [GitHub Copilot MCP doc
77
81
 
78
82
  Once configured, Copilot can autonomously invoke the MCP server's tools during task execution, using it to access documentation context and improve the quality of its code generation.
79
83
 
80
- </details>
84
+ ### GitHub Copilot CLI
85
+
86
+ To use the MCP server with [GitHub Copilot CLI](https://github.com/features/copilot/cli/), run the cli with `copilot` and prompt `/mcp add` to start the configuration of the MCP server
87
+
88
+ Follow the guided wizard to start using the DX MCP server:
89
+
90
+ 1. **Server Name**: `dx-docs`
91
+ 2. **Server Type**: `2` (HTTP)
92
+ 3. **URL**: `https://api.dev.dx.pagopa.it/mcp`
93
+ 4. **HTTP Headers**: `{"x-gh-pat": "<your-gh-PAT>"}`
94
+ 5. **Tools**: `*` (leave as is)
95
+
96
+ Use `Tab` to navigate between fields and `Ctrl+S` to save.
81
97
 
82
98
  ## Development
83
99
 
@@ -102,3 +118,14 @@ To build the Docker container for this application, run the following command fr
102
118
  ```bash
103
119
  docker build -t dx/mcp-server -f ./apps/mcpserver/Dockerfile .
104
120
  ```
121
+
122
+ ## Architecture
123
+
124
+ The architecture allows any Model Context Protocol (MCP) compliant client (such as GitHub Copilot) to query the [PagoPA DX technical documentation](https://dx.pagopa.it/) in natural language, receiving contextualized and up-to-date answers.
125
+
126
+ 1. **Content Upload**: On each release of the documentation website, Markdown and text files (`.md`, `.txt`) are uploaded to an S3 bucket.
127
+ 2. **Indexing**: From there, the documents are processed by **Amazon Bedrock Knowledge Bases**, which handles the embedding and semantic indexing process.
128
+ 3. **Vector Storage**: The resulting embeddings are saved in a Vector Bucket (an S3-based vector database), enabling efficient and persistent semantic search.
129
+ 4. **Query and Retrieval**: When an MCP client sends a query, an **AWS Lambda** function implementing the MCP Server queries the Knowledge Base to retrieve the most relevant content and returns the response to the client.
130
+
131
+ This approach allows AI agents like Copilot to access the documentation context in a structured way, keeping the orchestration, storage, and semantic retrieval layers separate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/dx-mcpserver",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "description": "An MCP server that support developers using DX tools.",
6
6
  "repository": {
@@ -32,6 +32,7 @@
32
32
  "@types/node": "^22.16.2",
33
33
  "@vitest/coverage-v8": "^3.2.4",
34
34
  "eslint": "^9.30.0",
35
+ "prettier": "3.6.2",
35
36
  "typescript": "~5.8.3",
36
37
  "vitest": "^3.2.4",
37
38
  "@pagopa/eslint-config": "^5.1.0"