Skip to main content

Mcp for Bing search with a given apiId

Project description

bing-search-mcp-wx

A Model Context Protocol (MCP) server implementation for Bing web search with UTF-8 support. This package provides a simple interface to perform Bing web searches through MCP tools.

Installation

Install using pip:

pip install bing-search-mcp-wx

Requires Python 3.10 or higher.

Configuration

The package requires a Bing API key to function. You can configure it in two ways:

  1. Environment variable: Create a .env file with:

    BING_API_KEY=your-api-key-here
    
  2. Programmatically:

    from bing_search_mcp_wx.server import initialize_mcp
    
    initialize_mcp("your-api-key-here")
    

Usage

Basic usage example:

from bing_search_mcp_wx.server import initialize_mcp, bing_search

# Initialize with your API key
initialize_mcp("your-api-key-here")

# Perform a basic search
results = bing_search("query")

# Search with custom result count
results = bing_search("query", result_count=5)

API Reference

initialize_mcp(apiKey: str)

Initialize the MCP server with the Bing API key.

  • Parameters:
    • apiKey (str): The Bing API key

bing_search(query: str, result_count: int = 10) -> str

Perform a web search using Bing.

  • Parameters:
    • query (str): The search query string
    • result_count (int, optional): Number of results to return. Defaults to 10
  • Returns:
    • JSON string containing the search results or error information

Dependencies

  • mcp[cli] >= 1.2.0
  • python-dotenv >= 1.0.0
  • requests >= 2.31.0

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bing_search_mcp_wx-0.1.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bing_search_mcp_wx-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file bing_search_mcp_wx-0.1.0.tar.gz.

File metadata

  • Download URL: bing_search_mcp_wx-0.1.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for bing_search_mcp_wx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 38a05045d29be783ffdf643b90737516539aba94012c24b6b334a0063812175c
MD5 20272cdcd558e68019f5896d95d26334
BLAKE2b-256 66cd34d543ec17cfae460b5dfc2bc2cba5f089da9f1629a09cbb91784059faee

See more details on using hashes here.

File details

Details for the file bing_search_mcp_wx-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bing_search_mcp_wx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4eb5015f1b2fd1d69dd3be3d6126dc92e3258defe1864a9323a63c1bf2650a6
MD5 d4c664e5642b31b994d1a967a3b53e66
BLAKE2b-256 40d700f01655420930defffecdb63cca852effdb24167a5869660a92139b71ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page