Skip to content

Commit 093c5e8

Browse files
authored
Update README (#5)
1 parent 0949b46 commit 093c5e8

File tree

1 file changed

+68
-62
lines changed

1 file changed

+68
-62
lines changed

README.md

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,96 @@
1-
# NDC-MCP Connector (Rust)
1+
# NDC-MCP Connector
22

3-
A Native Data Connector (NDC) that bridges Hasura's Data Delivery Network (DDN) with the Model Context Protocol (MCP), enabling seamless integration between DDN Engine and MCP. This connector is written in Rust.
3+
A Native Data Connector (NDC) that bridges Hasura DDN with Model Context Protocol (MCP) servers, exposing MCP resources as collections and tools as functions/procedures.
44

5-
## Overview
5+
## Features
66

7-
This connector allows you to:
7+
- **Dynamic Schema Generation**: Automatically generates NDC schema from MCP server introspection
8+
- **Multiple Transports**: Supports stdio (local processes) and HTTP (remote servers)
9+
- **Multiple Servers**: Connect to multiple MCP servers simultaneously
10+
- **Resource Mapping**: MCP resources → NDC collections
11+
- **Tool Execution**: MCP tools → NDC functions/procedures
12+
- **Naming Convention**: `{server_name}__{resource_or_tool}` pattern
813

9-
- Access MCP resources through NDC collections
10-
- Execute read-only MCP tools through NDC functions
11-
- Execute mutable MCP tools through NDC procedures
12-
- Generate a dynamic NDC schema from MCP resources and tools
14+
## Quick Start
1315

14-
## Features
16+
1. **Clone and build**:
1517

16-
- **Dynamic Schema Generation**: Automatically generates an NDC schema from MCP resources and tools
17-
- **Resource Mapping**: MCP resources are exposed as queryable collections in NDC
18-
- **Tool Execution**: MCP tools can be executed through NDC functions and procedures
19-
- **Multiple Server Support**: Connect to multiple MCP servers with different transport types
20-
- **Naming Convention**: Uses a `{server_name}__{resource_or_tool}` pattern to uniquely identify resources and tools
18+
```bash
19+
git clone https://github.com/hasura/ndc-mcp-rs.git
20+
cd ndc-mcp-rs
21+
cargo build
22+
```
2123

22-
## Prerequisites
24+
2. **Configure servers** in `configuration/servers.yaml`:
25+
26+
```yaml
27+
servers:
28+
filesystem:
29+
type: stdio
30+
command: npx
31+
args:
32+
["-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory"]
33+
34+
remote:
35+
type: http
36+
url: "http://localhost:8080/mcp"
37+
headers:
38+
Authorization: "Bearer your-token"
39+
timeout_seconds: 30
40+
```
41+
42+
3. **Generate configuration**:
2343
24-
- Rust 1.85.0 or later (with edition2024 support)
25-
- An MCP server to connect to (e.g., a filesystem MCP server)
44+
```bash
45+
just generate-config
46+
# or: cargo run --bin mcp-connector-cli -- --configuration configuration update --outfile configuration/configuration.json
47+
```
2648

27-
## Installation
49+
4. **Start the connector**:
2850

29-
1. Clone the repository:
3051
```bash
31-
git clone https://github.com/hasura/ndc-mcp-rs.git
32-
cd ndc-mcp-rs
52+
just serve
53+
# or: cargo run --bin mcp-connector -- serve --configuration configuration
3354
```
3455

35-
2. Build the project:
56+
5. **Test the schema**:
3657
```bash
37-
cargo build --release
58+
curl http://localhost:8080/schema | jq
3859
```
3960

4061
## Configuration
4162

42-
Create a `config.json` file in the `configuration` directory with the following structure:
43-
44-
```json
45-
{
46-
"servers": {
47-
"filesystem": {
48-
"type": "stdio",
49-
"command": "secure-filesystem-server",
50-
"args": ["--allowed-paths", "/path/to/allowed/directory"]
51-
},
52-
"remote_server": {
53-
"type": "http",
54-
"url": "http://localhost:8080/mcp",
55-
"headers": {
56-
"Authorization": "Bearer your-token-here"
57-
},
58-
"timeout_seconds": 30
59-
}
60-
}
61-
}
62-
```
63+
The connector uses a two-step configuration process:
6364

64-
You can configure multiple MCP servers with different transport types:
65+
1. **servers.yaml**: Define your MCP servers (this is what you edit)
66+
2. **configuration.json**: Generated automatically by introspecting the MCP servers
6567

66-
- **stdio**: For local MCP servers that communicate over standard input/output
67-
- **http**: For remote MCP servers that communicate over streamable HTTP transport (recommended for HTTP-based servers)
68+
### Transport Types
6869

69-
## Usage
70+
- **stdio**: For local MCP servers (Node.js packages, Python scripts, etc.)
71+
- **http**: For remote MCP servers using streamable HTTP transport
7072

71-
1. Start the NDC-MCP connector:
72-
```bash
73-
cargo run -- serve --configuration configuration
74-
```
73+
## Development
7574

76-
2. The connector will start on port 8080 by default. You can now use it with Hasura or any other NDC client.
75+
```bash
76+
# Build
77+
just build
7778

78-
3. Access the schema:
79-
```bash
80-
curl http://localhost:8080/schema | jq
81-
```
79+
# Format code
80+
just format
8281

83-
## License
82+
# Run clippy
83+
just clippy
84+
85+
# Generate config and serve
86+
just generate-config && just serve
87+
```
8488

85-
This project is licensed under the MIT License - see the LICENSE file for details.
89+
## Prerequisites
90+
91+
- Rust 1.85.0+ (edition 2021)
92+
- MCP servers to connect to
8693

87-
## Acknowledgements
94+
## License
8895

89-
- [Hasura NDC Specification](https://github.com/hasura/ndc-spec)
90-
- [Model Context Protocol](https://github.com/hasura/rmcp)
96+
MIT License - see LICENSE file for details.

0 commit comments

Comments
 (0)