|
| 1 | +--- |
| 2 | +title: "Quickstart (MCP with FalkorDB)" |
| 3 | +type: docs |
| 4 | +weight: 1 |
| 5 | +description: > |
| 6 | + How to get started running Toolbox with MCP Inspector and FalkorDB as the source. |
| 7 | +sample_filters: ["FalkorDB", "MCP Inspector"] |
| 8 | +is_sample: true |
| 9 | +--- |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +[Model Context Protocol](https://modelcontextprotocol.io) is an open protocol |
| 14 | +that standardizes how applications provide context to LLMs. Check out this page |
| 15 | +on how to [connect to Toolbox via |
| 16 | +MCP](../../../documentation/connect-to/mcp-client/_index.md). |
| 17 | + |
| 18 | +## Step 1: Set up your FalkorDB graph and data |
| 19 | + |
| 20 | +In this section, you'll start a FalkorDB instance and populate it with sample |
| 21 | +data for a movies-related agent. |
| 22 | + |
| 23 | +1. **Start FalkorDB.** The quickest way is Docker: |
| 24 | + |
| 25 | + ```bash |
| 26 | + docker run -d --name falkordb -p 6379:6379 falkordb/falkordb |
| 27 | + ``` |
| 28 | + |
| 29 | +1. **Populate the graph with data.** Using `redis-cli` (or the FalkorDB |
| 30 | + browser at `http://localhost:3000` if you expose it), create a small movie |
| 31 | + graph: |
| 32 | + |
| 33 | + ```bash |
| 34 | + docker exec falkordb redis-cli GRAPH.QUERY movies "CREATE |
| 35 | + (hanks:Person {name: 'Tom Hanks'}), |
| 36 | + (ryan:Person {name: 'Meg Ryan'}), |
| 37 | + (sleepless:Movie {title: 'Sleepless in Seattle', year: 1993}), |
| 38 | + (gump:Movie {title: 'Forrest Gump', year: 1994}), |
| 39 | + (hanks)-[:ACTED_IN]->(sleepless), |
| 40 | + (hanks)-[:ACTED_IN]->(gump), |
| 41 | + (ryan)-[:ACTED_IN]->(sleepless)" |
| 42 | + ``` |
| 43 | + |
| 44 | +## Step 2: Install and configure Toolbox |
| 45 | + |
| 46 | +In this section, we will download Toolbox and run the Toolbox server with a |
| 47 | +FalkorDB configuration. |
| 48 | + |
| 49 | +1. Download the latest version of Toolbox as a binary. Select the [correct |
| 50 | + binary](https://github.com/googleapis/mcp-toolbox/releases) corresponding |
| 51 | + to your OS and CPU architecture. |
| 52 | + |
| 53 | +1. Make the binary executable: |
| 54 | + |
| 55 | + ```bash |
| 56 | + chmod +x toolbox |
| 57 | + ``` |
| 58 | + |
| 59 | +1. Write the following into a `tools.yaml` file: |
| 60 | + |
| 61 | + ```yaml |
| 62 | + kind: source |
| 63 | + name: falkordb-movies |
| 64 | + type: falkordb |
| 65 | + host: 127.0.0.1 |
| 66 | + port: "6379" |
| 67 | + graph: movies |
| 68 | + --- |
| 69 | + kind: tool |
| 70 | + name: search_movies_by_actor |
| 71 | + type: falkordb-cypher |
| 72 | + source: falkordb-movies |
| 73 | + statement: | |
| 74 | + MATCH (m:Movie)<-[:ACTED_IN]-(p:Person) |
| 75 | + WHERE p.name = $name |
| 76 | + RETURN m.title, m.year |
| 77 | + LIMIT 10 |
| 78 | + description: Use this tool to list the movies a given actor acted in. |
| 79 | + parameters: |
| 80 | + - name: name |
| 81 | + type: string |
| 82 | + description: Full name of the actor. |
| 83 | + --- |
| 84 | + kind: tool |
| 85 | + name: execute_cypher |
| 86 | + type: falkordb-execute-cypher |
| 87 | + source: falkordb-movies |
| 88 | + description: Use this tool to execute a Cypher query against the movie graph. |
| 89 | + --- |
| 90 | + kind: tool |
| 91 | + name: get_schema |
| 92 | + type: falkordb-schema |
| 93 | + source: falkordb-movies |
| 94 | + description: Use this tool to get the schema of the movie graph. |
| 95 | + ``` |
| 96 | +
|
| 97 | +1. Start the Toolbox server: |
| 98 | +
|
| 99 | + ```bash |
| 100 | + ./toolbox --tools-file "tools.yaml" |
| 101 | + ``` |
| 102 | + |
| 103 | +## Step 3: Connect to MCP Inspector |
| 104 | + |
| 105 | +1. Run the MCP Inspector: |
| 106 | + |
| 107 | + ```bash |
| 108 | + npx @modelcontextprotocol/inspector |
| 109 | + ``` |
| 110 | + |
| 111 | +1. Type `y` when it asks to install the inspector package. |
| 112 | + |
| 113 | +1. It should show the following when the MCP Inspector is up and running: |
| 114 | + |
| 115 | + ```bash |
| 116 | + MCP Inspector is up and running at http://127.0.0.1:6274 |
| 117 | + ``` |
| 118 | + |
| 119 | +1. Open the above link in your browser. |
| 120 | + |
| 121 | +1. For `Transport Type`, select `Streamable HTTP`. |
| 122 | + |
| 123 | +1. For `URL`, type in `http://127.0.0.1:5000/mcp`. |
| 124 | + |
| 125 | +1. Click the `Connect` button. |
| 126 | + |
| 127 | +1. Click `List Tools` — you should see the `search_movies_by_actor`, |
| 128 | + `execute_cypher`, and `get_schema` tools. Select one and try it out: ask |
| 129 | + for Tom Hanks' movies, run an ad-hoc Cypher query, or fetch the graph |
| 130 | + schema. |
0 commit comments