Procurement MCP Server - Client

A Model Context Protocol (MCP) server implementation for retrieving and managing procurement data including Purchase Requisitions (PR), Purchase Orders (PO), and Goods Receipt Notes (GRN).

Overview

This project implements an open-source standard for connecting AI applications to external systems. The Procurement MCP Server enables AI assistants like Claude to seamlessly access and interact with procurement data through standardized tools and resources.

Features

  • Purchase Requisition (PR) Management: Query and retrieve purchase requisition data
  • Purchase Order (PO) Tracking: Access purchase order information and status
  • Goods Receipt Note (GRN) Processing: Retrieve goods receipt documentation and details
  • Standardized Protocol: Built on MCP's universal, open standard for connecting AI systems with data sources
  • Client Integration: Includes MCP client for testing and integration

Architecture

The project follows the standard MCP architecture:

MCP Servers: Three specialized servers exposing procurement data

  • mcpserverPR.py - Purchase Requisition server
  • mcpserverPO.py - Purchase Order server
  • mcpserverGRN.py - Goods Receipt Note server

MCP Client:

  • mcpclient.py - Client implementation for connecting to the servers

Setup

1. Clone the repository

(use the "development" branch if that's where the latest code lives):

git clone https://github.com/vinaygandhigit/procurementMCP.git
cd procurementMCP

2. Install Dependencies

pip install -r requirements.txt

3. Running MCP Servers

# Purchase Requisition Server
python mcpserverPR.py

# Purchase Order Server
python mcpserverPO.py

# Goods Receipt Note Server
python mcpserverGRN.py

4. Running MCP Client

python mcpclient.py

Calling MCP Server

PR_response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "retrieve purchase request PR-003"}]}
)
print("PR response:", PR_response['messages'][-1].content)

PO_response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "retrieve purchase order PO-2024-005"}]}
)
print("PO response:", PO_response['messages'][-1].content)

GRN_response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "retrieve goods receipt note 9006"}]}
)
print("GRN response:", GRN_response['messages'][-1].content)

Final Output

#### MCP Server PR
PR response:  [{"name":"search_pr","arguments":{"pr_id": "PR-001"}}]
This code searches for a purchase request with the ID "PR-001".

#### MCP Server PO

PO response:  The purchase order PO-2024-005 is from ChemCorp and was issued on January 19, 2024. The total amount for this purchase order is $3200 USD and its current status is Pending.

#### MCP Server GRN
GRN response:  The goods receipt note (GRN) number 9006 refers to the following details:

* Purchase Order Reference: PO-2024-006
* Received Date: February 6, 2024
* Received By: IT-Admin
* Condition: Good
* Items Received: 15