Gathering detailed insights and metrics for purchase-mcp-server
Gathering detailed insights and metrics for purchase-mcp-server
Gathering detailed insights and metrics for purchase-mcp-server
Gathering detailed insights and metrics for purchase-mcp-server
npm install purchase-mcp-server
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A TypeScript-based server for handling purchase-related operations, casefile management, and document processing.
You can configure the server in two ways:
Create a .env
file in the root directory:
1MONGO_URI=mongodb://localhost:27017 2DB_NAME=mcp_purchase 3TYPESENSE_HOST=localhost 4TYPESENSE_PORT=8108 5TYPESENSE_PROTOCOL=http 6TYPESENSE_API_KEY=your_typesense_api_key 7OPENAI_API_KEY=your_openai_api_key 8LLAMA_API_KEY=your_llama_api_key 9VENDOR_MODEL=gpt-4 10S3_API_TOKEN=your_s3_api_token 11S3_GENERATE_HTML_URL=your_s3_generate_html_url 12LLAMA_PARSE_URL=your_llama_parse_url 13PERPLEXITY_API_KEY=your_perplexity_api_key 14GOOGLE_CLIENT_ID=your_google_client_id 15GOOGLE_CLIENT_SECRET=your_google_client_secret 16GOOGLE_REDIRECT_URI=your_google_redirect_uri 17GOOGLE_API_KEY=your_google_api_key 18GOOGLE_SEARCH_ENGINE_ID=your_google_search_engine_id 19COHERE_API_KEY=your_cohere_api_key
Command line arguments will override values from the .env
file:
1node dist/index.js \ 2 --mongo-uri mongodb://localhost:27017 \ 3 --db-name mcp_purchase \ 4 --typesense-host localhost \ 5 --typesense-port 8108 \ 6 --typesense-protocol http \ 7 --typesense-api-key your_api_key \ 8 --openai-api-key your_openai_key \ 9 --llama-api-key your_llama_key \ 10 --vendor-model gpt-4 \ 11 --s3-api-token your_s3_token \ 12 --perplexity-api-key your_perplexity_key
Argument | Environment Variable | Default | Description |
---|---|---|---|
--mongo-uri | MONGO_URI | mongodb://localhost:27017 | MongoDB connection URI |
--db-name | DB_NAME | mcp_purchase | MongoDB database name |
--typesense-host | TYPESENSE_HOST | localhost | Typesense server host |
--typesense-port | TYPESENSE_PORT | 8108 | Typesense server port |
--typesense-protocol | TYPESENSE_PROTOCOL | http | Typesense protocol (http/https) |
--typesense-api-key | TYPESENSE_API_KEY | (empty) | Typesense API key |
--openai-api-key | OPENAI_API_KEY | (empty) | OpenAI API key |
--llama-api-key | LLAMA_API_KEY | (empty) | LlamaParse API key |
--vendor-model | VENDOR_MODEL | gpt-4 | Default LLM model |
--s3-api-token | S3_API_TOKEN | (empty) | S3 API token |
--s3-generate-html-url | S3_GENERATE_HTML_URL | (empty) | S3 HTML generation URL |
--llama-parse-url | LLAMA_PARSE_URL | (empty) | LlamaParse service URL |
--perplexity-api-key | PERPLEXITY_API_KEY | (empty) | Perplexity API key |
--google-client-id | GOOGLE_CLIENT_ID | (empty) | Google OAuth client ID |
--google-client-secret | GOOGLE_CLIENT_SECRET | (empty) | Google OAuth client secret |
--google-redirect-uri | GOOGLE_REDIRECT_URI | (empty) | Google OAuth redirect URI |
--google-api-key | GOOGLE_API_KEY | (empty) | Google API key |
--google-search-engine-id | GOOGLE_SEARCH_ENGINE_ID | (empty) | Google Custom Search Engine ID |
--cohere-api-key | COHERE_API_KEY | (empty) | Cohere API key |
1git clone https://github.com/yourusername/purchase_mcp_server.git 2cd purchase_mcp_server
1npm install
1npm run build
1npm start
For development with hot reload:
1npm run dev
Test the server with MCP Inspector:
1npm test
parse_document_link
: Parse documents from URLs or local fileswrite_casefile_data
: Create and update casefilesretrieve_casefile_data
: Search and retrieve casefilesget_all_vessel_purchase_requisitions
: Get vessel purchase requisitionsget_vessel_expense_data
: Retrieve vessel expense informationget_complete_vessel_budget_data
: Get comprehensive vessel budget informationfind_relevant_vendors
: Search for vendors by name, service, or locationget_vendor_contact_details
: Retrieve vendor contact informationgoogle_search
: Perform Google searchessmart_purchase_table_search
: Advanced purchase search with filterssmart_budget_search
: Advanced budget search with filterssmart_expense_search
: Advanced expense search with filtersvessel_info_search
: Search for vessel informationmongodb_find
: Direct MongoDB queriesget_purchase_requisition_details
: Get detailed purchase requisition informationget_purchase_order_details
: Get detailed purchase order informationlist_requisitions_by_status
: List requisitions filtered by statuslist_purchase_orders_by_status
: List purchase orders by statuslist_overdue_open_requisitions
: Find overdue requisitionslist_recent_vessel_purchase_requisitions
: Get recent vessel requisitionslist_top_expenses_by_category
: Get top expenses by categorysrc/
├── tools/
│ ├── documentTools.ts # Document processing and casefile management
│ ├── purchaseTools.ts # Purchase requisition and order management
│ ├── searchTools.ts # Search functionality
│ ├── vendorTools.ts # Vendor management
│ └── index.ts # Main tool handler
├── utils/
│ ├── config.ts # Configuration management with CLI support
│ ├── logger.ts # Logging utilities
│ ├── mongodb.ts # MongoDB client
│ ├── typesense.ts # Typesense client
│ └── llm.ts # LLM integration
├── types/
│ └── index.ts # TypeScript type definitions
└── index.ts # Main application entry point
The application implements comprehensive error handling:
Logging is implemented using Winston that:
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
No vulnerabilities found.
No security vulnerabilities found.