{ "$schema": "https://raw.githubusercontent.com/machanism-org/bindex-core/refs/heads/main/src/main/resources/schema/bindex-schema-v2.json", "id": "org.machanism.machai:bindex-core:1.4.2", "name": "org.machanism.machai:bindex-core", "version": "1.4.2", "description": "Bindex Core is a Java 17 library for creating, validating, registering, retrieving, and semantically recommending Bindex metadata for reusable software artifacts. It provides an AI-facing tool set for Model Context Protocol hosts and other automation: callers can retrieve a descriptor by Maven-style ID, HTTP URL, or project-relative file; request library recommendations from a natural-language requirement; and register descriptors from files, URLs, or in-memory JSON. Bindex descriptors capture artifact identity, Maven coordinates, classification, APIs, integration guidance, and practical examples. The library uses GenAI classification and embedding services together with a MongoDB-backed repository to support semantic discovery, library selection, governed reuse, and AI-assisted project assembly. It also exposes the Bindex v2 JSON Schema and a generation prompt so clients can produce valid metadata before publishing it.", "authors": [ { "name": "Viktor Tovstyi", "email": "viktor.tovstyi@gmail.com", "website": "https://machanism.org" } ], "license": "Apache License, Version 2.0", "classification": { "type": "library", "domains": [ "Software Library Discovery", "Metadata Management", "Semantic Search", "Generative AI Tool Integration", "Model Context Protocol", "Project Assembly" ], "languages": [ { "name": "Java", "version": "17" } ], "layers": [ "Interactors", "Adapters", "Infrastructure" ], "usageContext": [ "MCP server tool publication", "AI agent library discovery", "Maven build automation", "Java application integration", "Metadata catalog registration" ], "targetEnvironment": [ "Java" ], "integrations": [ "MongoDB", "Model Context Protocol" ] }, "location": { "repositoryType": "Maven", "repositoryUrl": "https://central.sonatype.com/artifact/org.machanism.machai/bindex-core", "coordinates": { "group": "org.machanism.machai", "artifactId": "bindex-core", "version": "1.4.2", "extension": "jar" } }, "constructors": [ { "package": "org.machanism.machai.bindex.ai.tools", "signature": "public org.machanism.machai.bindex.ai.tools.BindexFunctionTools()", "description": "Creates the AI function-tool provider that exposes Bindex descriptor retrieval, semantic library recommendation, and descriptor registration operations. The host supplies its project directory and configurator when invoking individual operations.", "examples": [ { "snippet": "org.machanism.machai.bindex.ai.tools.BindexFunctionTools tools = new org.machanism.machai.bindex.ai.tools.BindexFunctionTools();", "description": "Create the provider before a compatible AI or MCP host discovers its annotated tools, prompts, and schema resource." } ] } ], "features": [ { "name": "getBindex", "package": "org.machanism.machai.bindex.ai.tools", "signature": "public org.machanism.machai.schema.Bindex getBindex(java.lang.String id, java.lang.String query, java.io.File projectDir, org.machanism.macha.core.commons.configurator.Configurator configurator) throws java.io.IOException", "description": "Retrieves Bindex metadata from a registered Bindex ID, an HTTP(S) descriptor URL, or a file URL resolved relative to the active project directory. A GraphQL-style selection query can return only requested fields and reduce an AI tool response payload.", "examples": [ { "snippet": "org.machanism.machai.schema.Bindex descriptor = tools.getBindex(\"org.machanism.machai:bindex-core:1.4.2\", \"{ name version classification { languages } }\", new java.io.File(\".\"), configurator);", "description": "Retrieve the identity and classification needed by an agent without transferring the entire registered descriptor." } ] }, { "name": "getRecommendedLibraries", "package": "org.machanism.machai.bindex.ai.tools", "signature": "public java.util.Collection getRecommendedLibraries(java.lang.String prompt, double score, int vectorSearchLimits, org.machanism.macha.core.commons.configurator.Configurator configurator) throws java.io.IOException", "description": "Uses semantic vector search to recommend registered libraries for a natural-language development requirement. The score controls the minimum relevance and the limit controls the candidate count.", "examples": [ { "snippet": "java.util.Collection matches = tools.getRecommendedLibraries(\"Find Java libraries for AI-assisted software component discovery\", 0.85d, 25, configurator);", "description": "Ask for dependency candidates during project planning, then inspect selected records before adding dependencies." } ] }, { "name": "registerBindex", "package": "org.machanism.machai.bindex.ai.tools", "signature": "public java.lang.String registerBindex(java.lang.String path, java.io.File projectDir, org.machanism.macha.core.commons.configurator.Configurator configurator) throws java.io.IOException", "description": "Loads a Bindex JSON descriptor from a project-local path or HTTP(S) URL and registers or updates it in the configured Bindex repository.", "examples": [ { "snippet": "java.lang.String registeredId = tools.registerBindex(\"bindex.json\", new java.io.File(\".\"), configurator);", "description": "Publish the reviewed descriptor in the current Maven project so it can be discovered by semantic library search." } ] }, { "name": "registerBindexJson", "package": "org.machanism.machai.bindex.ai.tools", "signature": "public java.lang.String registerBindexJson(org.machanism.machai.schema.Bindex bindex, org.machanism.macha.core.commons.configurator.Configurator configurator)", "description": "Registers a Bindex descriptor already held in memory and returns its repository identifier, avoiding an intermediate file or remote download.", "examples": [ { "snippet": "java.lang.String registeredId = tools.registerBindexJson(descriptor, configurator);", "description": "Use this operation after an agent has generated and validated an org.machanism.machai.schema.Bindex object in memory." } ] } ], "customizations": [ { "name": "BINDEX_REPO_URL", "description": "Configures the MongoDB connection URI used by the Bindex repository. Point it at a local MongoDB Atlas Local instance or a managed MongoDB deployment appropriate for the environment.", "type": "configuration property", "examples": [ { "snippet": "set BINDEX_REPO_URL=mongodb://localhost:27017/?appName=machanism", "description": "On Windows Command Prompt, set the local repository URI before launching the application or MCP server." } ] }, { "name": "BINDEX_USER and BINDEX_PASSWORD", "description": "Supply repository authentication credentials when the configured MongoDB instance requires authentication.", "type": "configuration property", "examples": [ { "snippet": "set BINDEX_USER=user && set BINDEX_PASSWORD=pass", "description": "On Windows Command Prompt, configure the credentials used to connect to a local development repository." } ] } ], "studs": [], "examples": [ { "title": "Use Bindex Core from a Maven application", "steps": [ "Add the Maven dependency for org.machanism.machai:bindex-core:1.4.2 to the consuming project's dependencies.", "Configure a reachable MongoDB Bindex repository and the GenAI and embedding providers through the host Configurator.", "Create org.machanism.machai.bindex.ai.tools.BindexFunctionTools and call getRecommendedLibraries with a concrete requirement.", "Use getBindex to inspect a recommendation and registerBindex to publish the consuming project's reviewed descriptor." ], "dependency": "\n org.machanism.machai\n bindex-core\n 1.4.2\n", "scenario": "A Java build-planning service searches its approved component catalog for libraries that match an implementation request and records its own reusable metadata afterward." }, { "title": "Publish Bindex tools through a Machai MCP server", "steps": [ "Download machai-mcp-server.jar and bindex-core.jar, or add Bindex Core as a dependency of the MCP Server Maven Plugin.", "Configure GENAI_USERNAME, GENAI_PASSWORD, BINDEX_REPO_URL, BINDEX_USER, and BINDEX_PASSWORD for the deployment environment.", "Start org.machanism.machai.mcp.server.McpServer with both JAR files on the classpath and an available port such as 45000.", "Connect an MCP client such as Claude Desktop, Cursor, VS Code, JetBrains IDEs, Zed, or Warp and invoke get_bindex, pick_libraries, or register_bindex." ], "command": "java -cp machai-mcp-server.jar;bindex-core.jar org.machanism.machai.mcp.server.McpServer -p 45000", "scenario": "A team centrally publishes governed metadata lookup, semantic library selection, and registration tools to several MCP-compatible developer assistants on Windows." } ], "dependencies": [ "org.machanism.machai:genai-client:1.4.2", "org.tomlj:tomlj:2.1.1", "com.graphql-java:graphql-java:22.3", "org.apache.maven:maven-core:3.8.1", "org.mongodb:mongodb-driver-sync:5.6.4", "org.slf4j:slf4j-api:2.0.17" ] }