A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/VivekKumarNeu/MCP-Lucene-Server below:

GitHub - VivekKumarNeu/MCP-Lucene-Server: MCP Lucene Server

The MCP Lucene Server is a Java-based implementation of the Model Context Protocol (MCP) designed to provide efficient search and retrieval capabilities using Apache Lucene. This server allows you to manage and query documents, leveraging Lucene's powerful indexing and search features. It is built using Spring Boot for easy setup and deployment.

  1. Clone the repository:

    git clone [https://github.com/your-username/mcp-lucene-server.git](https://github.com/your-username/mcp-lucene-server.git)
    cd mcp-lucene-server
    

    (Replace your-username with your GitHub username)

  2. Build the project using Maven:

  1. Run the Spring Boot application:

    java -jar target/mcp-lucene-server-0.0.1-SNAPSHOT.jar

    (The exact name of the .jar file might vary slightly depending on your project version.)

  2. The server will start on port 8080 by default.

  1. Ensure you have Docker installed: Follow the instructions on the official Docker website: https://docs.docker.com/get-docker/

  2. Build the Docker image: Navigate to the root directory of your project in your terminal and run:

    docker build -t mcp-lucene-server .
  3. Run the Docker container:

    docker run -p 8080:8080 mcp-lucene-server

    This will map port 8080 on your host machine to port 8080 inside the container.

The server provides the following API endpoints:

Get server status:

curl http://localhost:8080/mcp/v1/status

Upsert documents:

curl -X POST 

http://localhost:8080/mcp/v1/upsert 

-H 'Content-Type: application/json' 

-d '{
"documents": [
{
"id": "doc1",
"text": "This is the text of document 1.",
"metadata": {
"category": "example",
"language": "english"
}
},
{
"id": "doc2",
"text": "This is document 2''s text.",
"metadata": {
"category": "sample",
"language": "spanish"
}
}
]
}'

Query documents:

curl -X POST 

http://localhost:8080/mcp/v1/query 

-H 'Content-Type: application/json' 

-d '{
"queries": [
{
"query": "document text",
"top_k": 5,
"filter": {
"language": "english"
}
}
]
}'

Delete documents:

curl -X POST 

http://localhost:8080/mcp/v1/delete 

-H 'Content-Type: application/json' 

-d '{
"ids": ["doc1"]
}'

List documents:

curl -X POST 

http://localhost:8080/mcp/v1/list 

-H 'Content-Type: application/json' 

-d '{
"ids": ["doc1", "doc2"]
}'

The server can be configured using Spring Boot's application properties. Here are some of the key properties:

You can set these properties in an application.properties or application.yml file in your src/main/resources directory, or by using environment variables.

Example application.properties:

server.port=8080 lucene.index.path=/path/to/lucene/index

This project is licensed under the Apache 2.0 License.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4