Thursday, July 30, 2026

Python script connect to local MCP(Model Context Protocol) Server and list available tools


MCP (Model Context Protocol) is an open standard that acts like "USB-C for AI applications." What is MCP?Introduced by Anthropic in late 2024 and now governed as an open, vendor-neutral protocol, MCP provides a standardized way for AI models and applications (like Claude, ChatGPT, or custom agents) to securely connect to external data sources, tools, and workflows. Instead of building custom integrations for every tool or database, developers create lightweight MCP servers that expose:
  • Resources (files, documents, database records, etc.)
  • Tools (actions like querying APIs, updating systems, or running code)
  • Prompts (reusable workflows or instructions)
AI applications use MCP clients to discover and interact with these servers via a consistent protocol (based on JSON-RPC).How Does MCP Help?
  • For users: AI becomes far more capable and personalized — it can access your files, calendars, databases, or business tools in real time and take meaningful actions, rather than just generating text.
  • For developers: It dramatically reduces integration complexity. One standard replaces dozens of bespoke connections, speeding up development while improving security and maintainability.
  • For the ecosystem: It enables plug-and-play interoperability across different AI models, tools, and platforms.
In short, MCP turns isolated AI chatbots into powerful, context-aware agents that can work with the real-world systems that matter. It's a foundational technology for building the next generation of practical AI applications.



Command Prompt Command to create Local MCP Server

C:\>npx @modelcontextprotocol/server-filesystem C:\Users\Ee" "Leen\mcp_test


Python script to act as MCP client to call the MCP server

Execute python script command: python mcp_filesystem_test.py

Python Script by ChatGPT

import asyncio

from mcp import ClientSession, StdioServerParameters

from mcp.client.stdio import stdio_client


async def main():

    server = StdioServerParameters(

        command="npx",

        args=[

            "@modelcontextprotocol/server-filesystem",

            r"C:\Users\Ee Leen\mcp_test"

        ]

    )


    async with stdio_client(server) as (read, write):

        async with ClientSession(read, write) as session:

            await session.initialize()

            tools = await session.list_tools()

            print("Available MCP tools:")

            for tool in tools.tools:

                print("-", tool.name)

asyncio.run(main())



Sunday, July 26, 2026

Sentiment Analysis of Robotic Surgery System using Data from Website 'OpenAlex'

 



Sentiment Analysis of Robotic Surgery Research Using OpenAlex

Robotic surgery has become one of the most exciting advancements in modern medicine. Systems like the da Vinci, Versius, and Senhance promise greater precision, smaller incisions, and faster patient recovery. But how is the research community truly reacting to this technology? To find out, we can use two powerful open tools: Sentiment Analysis and OpenAlex.What is Sentiment Analysis?Sentiment Analysis is a branch of Natural Language Processing (NLP) that automatically determines whether a piece of text expresses a positive, negative, or neutral tone. In research and healthcare, it helps us understand overall academic and clinical opinion without manually reading hundreds of papers.What is OpenAlex?OpenAlex is a free, massive, open catalog of the world’s scientific literature. It indexes millions of research papers, authors, and citations. Its public API allows anyone to search and retrieve the latest academic publications — making it an excellent resource for real-time research intelligence.What Did We Find About Robotic Surgery Systems?We analyzed the 10 most recent research articles related to robotic surgery systems using OpenAlex and VADER sentiment analysis. 

Key Observations:

While many papers continue to highlight the advantages of robotic surgery — such as improved precision, better ergonomics for surgeons, and enhanced visualization — the overall sentiment in the latest research leans mixed to cautious.

Common Concerns Highlighted in Recent Papers:

  • High acquisition and maintenance costs, limiting accessibility especially in developing countries and smaller hospitals.
  • Steep learning curve for surgical teams, which can affect initial patient outcomes.
  • Need for more long-term clinical data on safety, effectiveness, and cost-effectiveness.
  • Technical limitations in certain complex procedures.
This reflects a healthy stage in the technology’s development: the initial hype is giving way to critical evaluation and calls for more rigorous evidence.Why This Approach Is ValuableCombining OpenAlex with Sentiment Analysis offers a fast, data-driven way to monitor how emerging medical technologies are perceived by the scientific community. It helps:
  • Medical device companies identify improvement areas
  • Hospitals make informed purchasing decisions
  • Researchers spot gaps for future studies
As robotic surgery continues to evolve, keeping a pulse on research sentiment will be crucial for responsible innovation.



Python Code used

import requests
import pandas as pd
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from datetime import datetime

# Initialize Sentiment Analyzer
analyzer = SentimentIntensityAnalyzer()

def get_latest_robotic_surgery_articles(per_page=10):
    url = "https://api.openalex.org/works"
    
    params = {
        "search": "robotic surgery OR da vinci OR versius OR senhance OR robotic-assisted surgery",
        "per_page": per_page,
        "sort": "publication_date:desc",   # Latest first
        "filter": "type:article"
    }
    
    response = requests.get(url, params=params)
    
    if response.status_code != 200:
        print("API Error:", response.status_code)
        print(response.text)
        return None
    
    data = response.json()
    results = []
    
    for paper in data.get('results', []):
        abstract = paper.get('abstract') or "No abstract available"
        
        # Sentiment Analysis
        scores = analyzer.polarity_scores(abstract)
        compound = scores['compound']
        
        if compound >= 0.05:
            sentiment = "Positive"
        elif compound <= -0.05:
            sentiment = "Negative"
        else:
            sentiment = "Neutral"
        
        results.append({
            'OpenAlex_ID': paper.get('id', 'N/A').split('/')[-1],
            'Full_Title': paper.get('title', 'No title'),
            'Publication_Date': paper.get('publication_date'),
            'Year': paper.get('publication_year'),
            'Citations': paper.get('cited_by_count', 0),
            'Sentiment': sentiment,
            'Sentiment_Score': round(compound, 3),
            'Abstract': abstract[:380] + "..." if len(abstract) > 380 else abstract
        })
    
    df = pd.DataFrame(results)
    return df

# ========================
# Run Analysis
# ========================

print("🔍 Fetching the 10 Latest Articles on Robotic Surgery Systems...\n")

df = get_latest_robotic_surgery_articles(per_page=10)

if df is not None and not df.empty:
    # Display results
    pd.set_option('display.max_colwidth', None)
    display(df[['OpenAlex_ID', 'Full_Title', 'Publication_Date', 'Citations', 'Sentiment', 'Sentiment_Score']])
    
    print("\n" + "="*65)
    print("OVERALL SENTIMENT SUMMARY (Latest 10 Articles)")
    print("="*65)
    print(df['Sentiment'].value_counts())
    print(f"Average Sentiment Score: {df['Sentiment_Score'].mean():.3f}")
    
    # Optional: Save to CSV
    df.to_csv("latest_robotic_surgery_articles.csv", index=False)
    print("\n✅ Results saved to 'latest_robotic_surgery_articles.csv'")
else:
    print("No articles found.")